Linq query to find a folder name by it's partial name

Hey Community,

I have a question regarding how can we get a folder name from a list of folders with it’s partial name.

E.g. C:.…\1\1234_123
C:.…\1\4567_890

So a linq to return the folder with 1234_123 and I know up & until only the 1st part (i.e., 1234).

Kindly help if anyone has any solution to it

@souvik_c
the case looks more to get it solved with regex. Have a look below:
grafik

So a statement could look like:
Regex.Match(yourPathString, "\d+(?=_\d+)").Value

1 Like

No I think you misunderstood the question, I need the whole folder name (i.e., 1234_123) and I know only the initial part (i.e., upto 1234)

in that case you can do it like following:
grafik

Based on the datatype reflecting the folder list wa can go for alternates. Unfortunately this detail is missing.