Removes HTML and special characters from a string and collapses adjacent spaces to a single space.
- Namespace
- Statiq
.Common - Containing Type
- StringExtensions
Syntax
public static string RemoveHtmlAndSpecialChars(this string str, string replacement = " ")
Parameters
| Name | Type | Description |
|---|---|---|
| str | string | The string to remove HTML and special characters from. |
| replacement | string | An optional replacement string (a space by default). |
Return Value
| Type | Description |
|---|---|
| string | The string with HTML and special characters removed. |