Jimmu John Jimmu John - 1 year ago 88
Vb.net Question

How to return a string in between these "\" characters?

I have a string path that is "C:\folder\theStringIWant\anotherfolder"

I want to extract the string "theStringIWant" from that string, how would i do that?

Answer Source


DirectoryInfo d = new DirectoryInfo(@"C:\folder\theStringIWant\anotherfolder");
var whatYouWant = d.Parent;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download