string manipulation

Discussion in 'ASP .Net' started by Eugene Anthony, Apr 6, 2007.

  1. 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

    *** Sent via Developersdex http://www.developersdex.com ***
    Eugene Anthony, Apr 6, 2007
    #1
    1. Advertising

  2. 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.

    --
    Happy coding!
    Morten Wennevik [C# MVP]
    Morten Wennevik [C# MVP], Apr 6, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jared in ecs

    Perl string manipulation

    jared in ecs, Oct 22, 2003, in forum: Perl
    Replies:
    2
    Views:
    805
    Roy Johnson
    Oct 22, 2003
  2. Garfield

    String Array Manipulation Problem

    Garfield, Aug 27, 2003, in forum: ASP .Net
    Replies:
    5
    Views:
    2,811
    Michael Lang
    Aug 27, 2003
  3. Aaron

    String Manipulation

    Aaron, Dec 31, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    4,621
    Dave Davidson
    Dec 31, 2003
  4. Aaron

    Advanced String Manipulation (C#)

    Aaron, Jan 2, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    816
  5. Chris

    String manipulation

    Chris, May 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    449
    Pete Wright
    May 24, 2004
Loading...

Share This Page