string manipulation

  • Thread starter Thread starter Eugene Anthony
  • Start date Start date
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
 
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.
 
Back
Top