If I have a URL that looks like this:
/Person/30/John Doe
When I send it in the browser, it of course gets translated to:
/Person/30/John%20Doe
In order to make the URL easier to read, I wanted to replace the spaces with dashes. Then before the values get read by the database, I swap out the dashes for spaces. I did this and it works great. Except when I have a value that contains a dash already, it breaks. So the name John Gloria-Gonzales
becomes John Gloria Gonzales
.
What's the best way to do this without screwing up the existing dashes?