![]() |
BogaNet 1.4.0
|
Extension methods for strings. More...
Static Public Member Functions | |
| static string | BNReverse (this string str) |
| Reverses a string. | |
| static string | BNReplace (this string? str, string? oldString, string? newString, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Case insensitive 'Replace' per default. | |
| static string | BNRemoveChars (this string? str, params char[]? removeChars) |
| Removes characters from a string. | |
| static bool | BNEquals (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Case insensitive 'Equals' per default. | |
| static bool | BNContains (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Case insensitive 'Contains' per default. | |
| static bool | BNContainsAny (this string? str, params string[]? searchTerms) |
| Contains any given string. | |
| static bool | BNContainsAll (this string? str, params string[]? searchTerms) |
| Contains all given strings. | |
| static bool | BNStartsWith (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Checks if the string starts with another string. | |
| static bool | BNEndsWith (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Checks if the string ends with another string. | |
| static int | BNLastIndexOf (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Returns the index of the last occurence of a given string. | |
| static int | BNIndexOf (this string? str, string? toCheck, StringComparison comp=StringComparison.OrdinalIgnoreCase) |
| Returns the index of the first occurence of a given string. | |
| static byte[] | BNToByteArray (this string str, Encoding? encoding=null) |
| Converts the value of a string to a byte-array. | |
| static string | BNToString (this byte[] bytes, Encoding? encoding=null, int offset=0, int length=0) |
| Converts a byte-array to a string. | |
Extension methods for strings.
|
static |
Case insensitive 'Contains' per default.
| str | String-instance |
| toCheck | String to check |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Contains all given strings.
| str | String-instance |
| searchTerms | Search terms separated by the given split-character |
|
static |
Contains any given string.
| str | String-instance |
| searchTerms | Search terms separated by the given split-character |
|
static |
Checks if the string ends with another string.
| str | String-instance |
| toCheck | String to check |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Case insensitive 'Equals' per default.
| str | String-instance |
| toCheck | String to check |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Returns the index of the first occurence of a given string.
| str | String-instance |
| toCheck | String for the index |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Returns the index of the last occurence of a given string.
| str | String-instance |
| toCheck | String for the index |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Removes characters from a string.
| str | String-instance |
| removeChars | Characters to remove |
|
static |
Case insensitive 'Replace' per default.
| str | String-instance |
| oldString | String to replace |
| newString | New replacement string |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Reverses a string.
| str | String-instance |
|
static |
Checks if the string starts with another string.
| str | String-instance |
| toCheck | String to check |
| comp | StringComparison-method (optional, default: StringComparison.OrdinalIgnoreCase) |
|
static |
Converts the value of a string to a byte-array.
| str | Input string |
| encoding | Encoding of the string (optional, default: UTF8) |
|
static |
Converts a byte-array to a string.
| bytes | Input string as byte-array |
| encoding | Encoding of the string (optional, default: UTF8) |
| offset | Offset inside the byte-array (optional, default: 0) |
| length | Number of bytes (optional, default: 0 = all) |
| ArgumentNullException |