string manipulation

E

Eugene Anthony

Path:


images/5/Video1/qbert.flv


How do I retrieve images/5/Video1/ from

images/5/Video1/qbert.flv. This path

images/5/Video1/ can be different as in

Video1....Video100 and so on. I know that

we can use substring but the problem is

specifying the end position for retrieval.


How is it done?


Eugene Anthony
 
M

Morten Wennevik [C# MVP]

Hi Eugene,

Try using Path.GetDirectory(path). You'll end up with images\5\Video1, so if you want images/5/Video1/ you will have to string.Replace \ with / and add a / at the end as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top