AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

StringExtensions Members

The StringExtensions type exposes the following members.

Methods


  Name Description
Public method Static member Escape
Escapes the specified string in a compatible format with the Javascript escape method.
Public method Static member HTMLDecode
Writes the string through an HtmlTextWriter, which processes HTML entities.
Public method Static member HTMLEncode
HTML-encodes the string, converting special characters to their HTML entity equivalents.
Public method Static member IsGuid
Determines whether the string is a valid GUID format.
Public method Static member JavaScriptDeserialize
Deserializes a JavaScript-escaped string back to its original form. Wraps the input in quotes if not already present before deserializing.
Public method Static member JavaScriptSerialize
Serializes the string using the JavaScript serializer, escaping special characters for safe embedding in JavaScript. The surrounding quotes are removed from the result.
Public method Static member Left
Returns the left part of this string instance.
Public method Static member ReplaceFirst
A string extension method that replace first occurence.
Public method Static member Right
Returns the right part of the string instance.
Public method Static member SafeString
Returns the string value, or String if the string is null.
Public method Static member Shorten(String, Int32, Boolean)
Gets a Shortened version of a string
Public method Static member Shorten(String, Int32, Boolean, Boolean%)
Gets a Shortened version of a string
Public method Static member StripHTML
Removes all HTML tags from the string, returning only the text content.
Public method Static member ToAlphaNumeric
Removes all non-alphanumeric characters except spaces and hyphens from the string.
Public method Static member ToCamelCase
Inserts spaces into a PascalCase or camelCase string to produce human-readable text.
Public method Static member ToDateTime
Parses the string as a DateTime, returning null if the string is empty or invalid.
Public method Static member ToDouble
Parses the string as a double, returning the specified default value if parsing fails.
Public method Static member ToGuid
Parses the string as a Guid, returning null if the string is empty or invalid.
Public method Static member ToInteger
Parses the object as an integer, returning the specified default value if parsing fails. Handles enum values, strings, and other objects via ToString().
Public method Static member ToLineBreakToHtml
Replaces environment newline characters with HTML line break tags.
Public method Static member ToSpaceToHtml
Replaces space characters with HTML non-breaking space entities.
Public method Static member ToTabToHtml
Replaces tab characters with HTML non-breaking space entities (4 spaces per tab).
Public method Static member TrimPunctuation
Removes trailing punctuation characters from the end of the string.
Public method Static member TrimWhiteSpace
Trims whitespace characters including carriage returns, newlines, form feeds, tabs, and vertical tabs.
Public method Static member Unscape
Unescapes the specified string in a compatible format with the Javascript escape method.
Public method Static member UrlFriendly
Creates a string that is Url-friendly.