souvik_c
(Souvik Charaborty)
1
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
ppr
(Peter Preuss)
2
@souvik_c
the case looks more to get it solved with regex. Have a look below:
So a statement could look like:
Regex.Match(yourPathString, "\d+(?=_\d+)").Value
1 Like
souvik_c
(Souvik Charaborty)
3
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)
ppr
(Peter Preuss)
4
in that case you can do it like following:
Based on the datatype reflecting the folder list wa can go for alternates. Unfortunately this detail is missing.