Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > web sddress substring

Reply
Thread Tools

web sddress substring

 
 
=?Utf-8?B?Sm9u?=
Guest
Posts: n/a
 
      11-30-2004
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
 
Reply With Quote
 
 
 
 
Jignesh Desai
Guest
Posts: n/a
 
      11-30-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      11-30-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Substring' Anako ASP .Net 1 04-07-2009 10:18 AM
'System.Web.UI.WebControls.TextBox' does not contain a definition for 'Substring' Anako General Computer Support 0 04-07-2009 07:04 AM
Finding a SubString within a String Badass Scotsman ASP .Net 2 03-31-2006 04:00 PM
RegEx search for a substring within a substring colinhumber@gmail.com Perl Misc 3 08-03-2005 04:29 PM
find if there is a given substring inside a string juli ASP .Net 3 12-06-2004 11:52 AM



Advertisments