web sddress substring

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9u?=, Nov 30, 2004.

  1. Hello all,

    I seem to be having one of those days today when notihng works!

    I need to get 'news' (or whatever other folder name I'm at) from the
    following address:

    http://ww.dev.com/news/page.aspx

    I've tried a number of lines using substring etc, can anyone please help?

    Thanks

    Jon
    =?Utf-8?B?Sm9u?=, Nov 30, 2004
    #1
    1. Advertising

  2. Reverse the string.
    use split method to split by "/"
    access 2 element of an array after u split.

    Eg: String.reverse.split("/").(2)

    Regards,
    Jignesh Desai.



    "Jon" <> wrote in message
    news:...
    > Hello all,
    >
    > I seem to be having one of those days today when notihng works!
    >
    > I need to get 'news' (or whatever other folder name I'm at) from the
    > following address:
    >
    > http://ww.dev.com/news/page.aspx
    >
    > I've tried a number of lines using substring etc, can anyone please help?
    >
    > Thanks
    >
    > Jon
    Jignesh Desai, Nov 30, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?Sm9u?=

    Karl Seguin Guest

    Why not use what the .net framework makes available?

    Check out Request.Url which returns a useful Uri instance. Specifically
    the Segements property of the Uri class

    karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Jon" <> wrote in message
    news:...
    > Hello all,
    >
    > I seem to be having one of those days today when notihng works!
    >
    > I need to get 'news' (or whatever other folder name I'm at) from the
    > following address:
    >
    > http://ww.dev.com/news/page.aspx
    >
    > I've tried a number of lines using substring etc, can anyone please help?
    >
    > Thanks
    >
    > Jon
    Karl Seguin, Nov 30, 2004
    #3
    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. juli
    Replies:
    3
    Views:
    8,841
    Shiva
    Dec 6, 2004
  2. Badass Scotsman

    Finding a SubString within a String

    Badass Scotsman, Mar 31, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,099
    S. Justin Gengo
    Mar 31, 2006
  3. Sean
    Replies:
    0
    Views:
    326
  4. Anako
    Replies:
    1
    Views:
    1,858
    imransyed63
    Apr 7, 2009
  5. Replies:
    3
    Views:
    182
    Sherm Pendley
    Aug 3, 2005
Loading...

Share This Page