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

File Exist 5
Mandatory Elements To Conduct JavaScript Form Manipulation 7
Image issues 0
string manipulation 4
Redirection Handling 2
session 1
Help with my responsive home page 2
Stuck with html and css 25

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top