Click or drag to resize

StringUtils Methods

The StringUtils type exposes the following members.

Methods
  NameDescription
Public methodStatic memberBase36Decode
Decodes a base36 encoded string to an integer
Public methodStatic memberBase36Encode
Encodes an integer into a string by mapping to alpha and digits (36 chars) chars are embedded as lower case Example: 4zx12ss
Public methodStatic memberBinHexToString
Turns a BinHex string that contains raw byte values into a byte array
Public methodStatic memberDisplayMemo
Fixes a plain text field for display as HTML by replacing carriage returns with the appropriate br and p tags for breaks.
Public methodStatic memberDisplayMemoEncoded
Method that handles handles display of text by breaking text. Unlike the non-encoded version it encodes any embedded HTML text
Public methodStatic memberExpandUrls
Expands links into HTML hyperlinks inside of text or HTML.
Public methodStatic memberExtractString
Extracts a string from between a pair of delimiters. Only the first instance is found.
Public methodStatic memberFixHTMLForDisplay
Replaces and and Quote characters to HTML safe equivalents.
Public methodStatic memberFromCamelCase
Tries to create a phrase string from CamelCase text. Will place spaces before capitalized letters. Note that this method may not work for round tripping ToCamelCase calls, since ToCamelCase strips more characters than just spaces.
Public methodStatic memberGetProperty
Retrieves a value from an XML-like string
Public methodStatic memberGetUrlEncodedKey
Retrieves a value by key from a UrlEncoded string.
Public methodStatic memberHtmlAbstract
Creates an Abstract from an HTML document. Strips the HTML into plain text, then creates an abstract.
Public methodStatic memberHtmlEncode
HTML-encodes a string and returns the encoded string.
Public methodStatic memberNewStringId
Creates short string id based on a GUID hashcode. Not guaranteed to be unique across machines, but unlikely to duplicate in medium volume situations.
Public methodStatic memberNormalizeIndentation
Strips any common white space from all lines of text that have the same common white space text. Effectively removes common code indentation from code blocks for example so you can get a left aligned code snippet.
Public methodStatic memberParseDecimal
Parses an string into an decimal. If the value can't be parsed a default value is returned instead
Public methodStatic memberParseInt(String, Int32)
Parses an string into an integer. If the value can't be parsed a default value is returned instead
Public methodStatic memberParseInt(String, Int32, IFormatProvider)
Parses an string into an integer. If the value can't be parsed a default value is returned instead
Public methodStatic memberProperCase
Return a string in proper Case format
Public methodStatic memberReplaceString
Replaces a substring within a string with another substring with optional case sensitivity turned off.
Public methodStatic memberReplaceStringInstance
String replace function that support
Public methodStatic memberReplicate(Char, Int32)
Replicates a character n number of times and returns a string
Public methodStatic memberReplicate(String, Int32)
Replicates an input string n number of times
Public methodStatic memberSetProperty
Public methodStatic memberSetUrlEncodedKey
Allows setting of a value in a UrlEncoded string. If the key doesn't exist a new one is set, if it exists it's replaced with the new value.
Public methodStatic memberStringToStream(String)
Creates a Stream from a string. Internally creates a memory stream and returns that.
Public methodStatic memberStringToStream(String, Encoding)
Creates a Stream from a string. Internally creates a memory stream and returns that.
Public methodStatic memberStripHtml
Strips HTML tags out of an HTML string and returns just the text.
Public methodStatic memberStripNonNumber
Strips all non digit values from a string and only returns the numeric string.
Public methodStatic memberTerminateString
Terminates a string with the given end string/character, but only if the value specified doesn't already exist and the string is not empty.
Public methodStatic memberTextAbstract
Returns an abstract of the provided text by returning up to Length characters of a text string. If the text is truncated a ... is appended.
Public methodStatic memberToCamelCase
Takes a phrase and turns it into CamelCase text. White Space, punctuation and separators are stripped
Public methodStatic memberTrimStart
Trims a sub string from a string
Public methodStatic memberTrimTo
Trims a string to a specific number of max characters
Public methodStatic memberUrlDecode
UrlDecodes a string without requiring System.Web
Public methodStatic memberUrlEncode
UrlEncodes a string without the requirement for System.Web
Top
See Also