![]() | StringUtils Class |
Namespace: Koden.Utils
The StringUtils type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | Base36Decode |
Decodes a base36 encoded string to an integer
|
![]() ![]() | Base36Encode |
Encodes an integer into a string by mapping to alpha and digits (36 chars)
chars are embedded as lower case
Example: 4zx12ss
|
![]() ![]() | BinHexToString |
Turns a BinHex string that contains raw byte values
into a byte array
|
![]() ![]() | DisplayMemo |
Fixes a plain text field for display as HTML by replacing carriage returns
with the appropriate br and p tags for breaks.
|
![]() ![]() | DisplayMemoEncoded |
Method that handles handles display of text by breaking text.
Unlike the non-encoded version it encodes any embedded HTML text
|
![]() ![]() | ExpandUrls |
Expands links into HTML hyperlinks inside of text or HTML.
|
![]() ![]() | ExtractString |
Extracts a string from between a pair of delimiters. Only the first
instance is found.
|
![]() ![]() | FixHTMLForDisplay |
Replaces and and Quote characters to HTML safe equivalents.
|
![]() ![]() | FromCamelCase |
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.
|
![]() ![]() | GetProperty |
Retrieves a value from an XML-like string
|
![]() ![]() | GetUrlEncodedKey |
Retrieves a value by key from a UrlEncoded string.
|
![]() ![]() | HtmlAbstract |
Creates an Abstract from an HTML document. Strips the
HTML into plain text, then creates an abstract.
|
![]() ![]() | HtmlEncode |
HTML-encodes a string and returns the encoded string.
|
![]() ![]() | NewStringId |
Creates short string id based on a GUID hashcode.
Not guaranteed to be unique across machines, but unlikely
to duplicate in medium volume situations.
|
![]() ![]() | NormalizeIndentation |
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.
|
![]() ![]() | ParseDecimal |
Parses an string into an decimal. If the value can't be parsed
a default value is returned instead
|
![]() ![]() | ParseInt(String, Int32) |
Parses an string into an integer. If the value can't be parsed
a default value is returned instead
|
![]() ![]() | ParseInt(String, Int32, IFormatProvider) |
Parses an string into an integer. If the value can't be parsed
a default value is returned instead
|
![]() ![]() | ProperCase |
Return a string in proper Case format
|
![]() ![]() | ReplaceString |
Replaces a substring within a string with another substring with optional case sensitivity turned off.
|
![]() ![]() | ReplaceStringInstance |
String replace function that support
|
![]() ![]() | Replicate(Char, Int32) |
Replicates a character n number of times and returns a string
|
![]() ![]() | Replicate(String, Int32) |
Replicates an input string n number of times
|
![]() ![]() | SetProperty | |
![]() ![]() | SetUrlEncodedKey |
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.
|
![]() ![]() | StringToStream(String) |
Creates a Stream from a string. Internally creates
a memory stream and returns that.
|
![]() ![]() | StringToStream(String, Encoding) |
Creates a Stream from a string. Internally creates
a memory stream and returns that.
|
![]() ![]() | StripHtml |
Strips HTML tags out of an HTML string and returns just the text.
|
![]() ![]() | StripNonNumber |
Strips all non digit values from a string and only
returns the numeric string.
|
![]() ![]() | TerminateString |
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.
|
![]() ![]() | TextAbstract |
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.
|
![]() ![]() | ToCamelCase |
Takes a phrase and turns it into CamelCase text.
White Space, punctuation and separators are stripped
|
![]() ![]() | TrimStart |
Trims a sub string from a string
|
![]() ![]() | TrimTo |
Trims a string to a specific number of max characters
|
![]() ![]() | UrlDecode |
UrlDecodes a string without requiring System.Web
|
![]() ![]() | UrlEncode |
UrlEncodes a string without the requirement for System.Web
|