© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
3y ago
•
1 reply
ivi
❔ Find common substring at start of every string in list
I have a list of Windows path strings and I want to determine the common beginning shared by all of them
, if such a thing exists
.
So
, a list like
:
C:\User\hi.txt
C:\User\b.txt
C:\User\hh.txt
C:\User\hi.txt
C:\User\b.txt
C:\User\hh.txt
would output the string
C:\User\
C:\User\
.
How to smoothly accomplish such a thing
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Find all instances of a substring in a string
C
C# / help
10mo ago
❔ List string variables
C
C# / help
3y ago
Searching a string for a substring containing operators
C
C# / help
4y ago