I got the following code from this question: http://stackoverflow.com/questions/539920/what-is-the-best-way-to-clean-a-string-for-placement-in-a-url-like-the-question
$str = strtolower(
preg_replace( array('/[^a-z0-9\- ]/i', '/[ \-]+/'), array('', '-'),
$urlPart ) );
This code works for me with PHP, its making clean and SEO'd url's in just one line, but I want to use the same script in my ASP.NET(C#) application. But don't know what will be the code for this line in C#. Can anyone please convert this PHP code into C# function.
Thanks