C
C#2y ago
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\. How to smoothly accomplish such a thing?
1 Reply
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server