Class WebStringHelper
Helper that removes all tags from specified string except tags marked as safe in 'EPiServer.Configuration.Settings.UISafeHtmlTags'>
Inheritance
Namespace: EPiServer.Core.Html
Assembly: EPiServer.dll
Version: 12.0.3Syntax
public class WebStringHelper : Object
Constructors
WebStringHelper()
Declaration
public WebStringHelper()
Methods
BuildRegularExpression(String[])
Creates a regular expression to be able to restore an array of html tags.
Declaration
public static string BuildRegularExpression(string[] safeTags)
Parameters
Type | Name | Description |
---|---|---|
System. |
safeTags | The html tags that you want to appear as tags instead of encoded text. |
Returns
Type | Description |
---|---|
System. |
A regular expression to be able to restore an array of html tags. |
EncodeForWebString(String)
Encodes a string to be displayed on a web page.
Declaration
public static string EncodeForWebString(string stringValue)
Parameters
Type | Name | Description |
---|---|---|
System. |
stringValue | The string value. |
Returns
Type | Description |
---|---|
System. |
A string where all html tags except those defined in 'EPiServer.Configuration.Settings.UISafeHtmlTags' have been encoded and therefore will appear in the text instead of tags. |
Remarks
The character '& will also be encoded to '&'.