SEO Friendly String Sanitizer
This is a small .Net library that performs the string conversion into a sanitized version that can be included in the URL. It performs diacritical folding, removing of punctuation and replacing whitespace with URL friendly dashes.
This work is based on the diacritical folding work of Peter Ritchie (MVP) published on MSDN blog, which is further based on Draft UTR #30: Unicode Character Foldings and the associated datafile.
The library and provided on an "as is" basis.
Installation
The library is available as a NuGet package or by cloning the GitHub repository and building it directly.
Usage
using Netko.Common.Util.Seo;
...
string output = SeoFriendlyStringSanitizer.Sanitize(input);
History
- [2011-09-07] v1.0.2: Skipping '+' characters from the folded string
- [2011-09-07] v1.0.1: Stripping HTML elements from the input string
- [2011-09-03] v1.0.0: Initial release
Resources
- Getting the library: NuGet package
- The Unicode Consortium: http://www.unicode.org/
- Origin MSDN Blog Post: Stripping diacriticals from string?