Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Need help in RegEx

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JM - 29 Aug 2006 18:39 GMT
Hi,

I don't know much about regex and need a help. I have got :

1. Original string: http://www.rediff.com/general/story/9622681/id=123

2. and I want to convert it into
http://www.rediff.com/general/story/print/9622681/id=123

See the "print". This is the only additional directory in #2.

Basically I need a way by which I can apply a RegEx to original string
(i.e. #1) and should get the desired URL as in #2.

And if this can be done in one step that would be great as I need to
create a function which should do this conversion for all these kind of
URLs.

Thanks
JM
Bruce Wood - 29 Aug 2006 21:59 GMT
> Hi,
>
[quoted text clipped - 13 lines]
> create a function which should do this conversion for all these kind of
> URLs.

What is wrong with:

string newUrl = oldUrl.Replace("/story/", "/story/print/");

?
JM - 30 Aug 2006 09:06 GMT
Thanks.. It works..

> > Hi,
> >
[quoted text clipped - 19 lines]
>
> ?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.