you can use a regex
say (notepad code):
var cleanedUrl = new Regex("[^-a-z0-9]",
RegexOptions.IgnoreCase).Replace(url, "-");

maybe then I'd add a   new regex("-+").Replace(cleanedUrl, "-") to avoid
double '-' characters




On Wed, Feb 11, 2009 at 6:38 PM, eyal <ebarda...@gmail.com> wrote:

>
> Hi All,
>
> I need to convert a string into url compatible format. For example,
>
> Product cost $24.00 & higher/lower.    <- original string
>
> product-cost-24-00-higher-lower          <- url format
>
> I know that I can use string.Replace()  but there are alot of
> characters that I may have to replace to accommodate a proper url. Is
> there a function that is already written that I can use?
>
> thanks
>
> eyal
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to castle-project-users@googlegroups.com
To unsubscribe from this group, send email to 
castle-project-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to