![]() |
Sphyrnidae Common Library
2.0.1
Shared Utilities/Library
|
String custom methods More...
Static Public Member Functions | |
static bool | IsEqual (this string s1, string s2, StringComparison comparison=StringComparison.CurrentCultureIgnoreCase) |
Performs check against any 2 strings (accounts for null, and trims extra whitespace) More... | |
static bool | IsLessThan (this string left, string right, StringComparison comparison=StringComparison.CurrentCultureIgnoreCase) |
< operator More... | |
static bool | IsLessThanOrEqual (this string left, string right, StringComparison comparison=StringComparison.CurrentCultureIgnoreCase) |
<= operator More... | |
static bool | IsMoreThan (this string left, string right, StringComparison comparison=StringComparison.CurrentCultureIgnoreCase) |
> operator More... | |
static bool | IsMoreThanOrEqual (this string left, string right, StringComparison comparison=StringComparison.CurrentCultureIgnoreCase) |
>= operator More... | |
static bool | Like (this string str, string contains, StringComparison comp=StringComparison.CurrentCultureIgnoreCase) |
Performs a "like" operation (contains, but case insensitive) More... | |
static string | RemoveAfter (this string s, char delimiter, bool keepDelimiter=true) |
Removes everything after the given delimiter More... | |
static string | RemoveBefore (this string s, char delimiter, bool keepDelimiter=true) |
Removes everything before the given delimiter More... | |
static string | KeepBefore (this string s, char delimiter) |
Keeps everything before the given delimiter More... | |
static string | KeepAfter (this string s, char delimiter) |
Keeps everything after the given delimiter More... | |
static string | Trimmed (this string s) |
Obtains a usable string from a post/request/database, etc (will be not null and trimmed - possibly "") More... | |
static string | RemoveSpecialChars (this string str) |
This removes all special characters from the string More... | |
static string | Shorten (this string s, int length) |
Shortens a string to the desired length More... | |
static string | ShortenWithEllipses (this string s, int length) |
static IEnumerable< string > | SafeSplit (this string s, string delimiter, StringSplitOptions option=StringSplitOptions.None) |
Splits a string on another string (same as a character split) More... | |
static IEnumerable< string > | SafeSplit (this string s, string delimiter, bool removeEmpties) |
Splits a string on another string (same as a character split) More... | |
static IEnumerable< string > | SafeSplit (this string s, string delimiter, StringSplitOptions option, bool removeEmpties) |
Splits a string on another string (same as a character split) More... | |
static string | Reverse (this string str) |
Reverses a string More... | |
static string | Pluralize (this string s) |
Pluralizes a given word (not fully implemented properly, but works) More... | |
static string | Capitalize (this string str) |
Capitalizes the first letter in the string More... | |
static string | SplitCamelCase (this string s) |
Converts the given string to readable format (spaces in camel casing) More... | |
static string | ToHtml (this string str) |
This encodes a user typed string as HTML to be displayed directly onto a Web page More... | |
static string | ToCsv (this string str) |
This encodes a string for exporting as a CSV file More... | |
static string | ToExcel (this string str) |
This encodes a string for exporting as an excel file More... | |
static string | DecodeUri (this string uri) |
Decodes a string that was encoded using javascript's "encodeURIComponent" function More... | |
static string | EncodeUri (this string uri) |
Encodes a string so that it will appear as-is when retrieved from the client via the URI More... | |
String custom methods
|
static |
Capitalizes the first letter in the string
str | The string to be capitalized |
|
static |
Decodes a string that was encoded using javascript's "encodeURIComponent" function
uri | The string to decode |
|
static |
Encodes a string so that it will appear as-is when retrieved from the client via the URI
uri | The string to encode |
|
static |
Performs check against any 2 strings (accounts for null, and trims extra whitespace)
s1 | First string |
s2 | Second string |
comparison | Optional: Default = CurrentCultureIgnoreCase |
|
static |
< operator
left | The left value |
right | The right value |
comparison | Optional: Default = CurrentCultureIgnoreCase |
|
static |
<= operator
left | The left value |
right | The right value |
comparison | Optional: Default = CurrentCultureIgnoreCase |
|
static |
> operator
left | The left value |
right | The right value |
comparison | Optional: Default = CurrentCultureIgnoreCase |
|
static |
>= operator
left | The left value |
right | The right value |
comparison | Optional: Default = CurrentCultureIgnoreCase |
|
static |
Keeps everything after the given delimiter
s | The string being manipulated |
delimiter | Where to split apart the string |
|
static |
Keeps everything before the given delimiter
s | The string being manipulated |
delimiter | Where to split apart the string |
|
static |
Performs a "like" operation (contains, but case insensitive)
str | The original string |
contains | The string to check if the original string contains it |
comp | The comparison to use (Default = CurrentCultureIgnoreCase) |
|
static |
Pluralizes a given word (not fully implemented properly, but works)
s | The word to be pluralized |
|
static |
Removes everything after the given delimiter
s | The string being manipulated |
delimiter | Where to split apart the string |
keepDelimiter | If you should keep the delimiter, or remove it |
|
static |
Removes everything before the given delimiter
s | The string being manipulated |
delimiter | Where to split apart the string |
keepDelimiter | If you should keep the delimiter, or remove it |
|
static |
This removes all special characters from the string
str | The original string |
|
static |
Reverses a string
str | The original string |
|
static |
Splits a string on another string (same as a character split)
s | The string to split |
delimiter | The string which will delimit the original string |
removeEmpties | If empty elements (IsNullOrWhiteSpace) will be removed from the list (default false) |
|
static |
Splits a string on another string (same as a character split)
s | The string to split |
delimiter | The string which will delimit the original string |
option | How to split the string (Default no options) |
removeEmpties | If empty elements (IsNullOrWhiteSpace) will be removed from the list (default false) |
|
static |
Splits a string on another string (same as a character split)
s | The string to split |
delimiter | The string which will delimit the original string |
option | How to split the string (Default no options) |
|
static |
Shortens a string to the desired length
s | The string being manipulated |
length | The desired length |
|
static |
|
static |
Converts the given string to readable format (spaces in camel casing)
s | The string to work on |
|
static |
This encodes a string for exporting as a CSV file
str | The string to encode |
|
static |
This encodes a string for exporting as an excel file
str | The string to encode |
|
static |
This encodes a user typed string as HTML to be displayed directly onto a Web page
str | The string to encode |
|
static |
Obtains a usable string from a post/request/database, etc (will be not null and trimmed - possibly "")
s | The string being checked |