|
static bool | StartsWithInvariant (this string s, string v, bool ignore_case=false) |
| Quality of life extension method to check whether a string starts with another string using invariant culture. More...
|
|
static bool | EndsWithInvariant (this string s, string v, bool ignore_case=false) |
| Quality of life extension method to check whether a string ends with another string using invariant culture. More...
|
|
static string | ToPlatformPath (this string s) |
| Converts Windows directory separators in a path to the appropriate one for the platform if necessary. More...
|
|
static string | RemovePrefix (this string s, string prefix) |
| Removes the prefix if the string has one. More...
|
|
static string | RemoveSuffix (this string s, string suffix) |
| Removes the suffix if the string has one. More...
|
|
static string | ToTitleCaseInvariant (this string s) |
| Quality of life extension method to turn the string into title case using invariant culture. More...
|
|
static bool | IsPureASCII (this string input) |
| Detects whether the string consists of just ASCII (0-255) characters. More...
|
|
static int | Count (this string @in, char c) |
| Counts occurences of a single character in a string. More...
|
|
static string | FirstFromSplit (this string source, char delimiter) |
| Gets the first element of the string if it was split by delimiter , without actually splitting the string (and using up memory). More...
|
|
static string | FirstFromSplit (this string source, string delimiter) |
| Gets the first element of the string if it was split by delimiter , without actually splitting the string (and using up memory). More...
|
|
static SplitPair | SplitIntoPair (this string source, string delimiter) |
| Splits a string into a pair of the first element and everything past the first delimiter. More...
|
|
◆ Count()
static int Semi.StringExt.Count |
( |
this string @ |
in, |
|
|
char |
c |
|
) |
| |
|
inlinestatic |
Counts occurences of a single character in a string.
- Returns
- The number of times that the character appears in the string.
- Parameters
-
in | Target string. |
c | Character to count. |
◆ EndsWithInvariant()
static bool Semi.StringExt.EndsWithInvariant |
( |
this string |
s, |
|
|
string |
v, |
|
|
bool |
ignore_case = false |
|
) |
| |
|
inlinestatic |
Quality of life extension method to check whether a string ends with another string using invariant culture.
- Returns
true
, if the string ends with the provided text, false
otherwise.
- Parameters
-
s | Target string. |
v | Suffix string to check. |
ignore_case | If set to true ignore case. |
◆ FirstFromSplit() [1/2]
static string Semi.StringExt.FirstFromSplit |
( |
this string |
source, |
|
|
char |
delimiter |
|
) |
| |
|
inlinestatic |
Gets the first element of the string if it was split by delimiter
, without actually splitting the string (and using up memory).
- Returns
- The first element, or the same string if the delimiter doesn't occur at all.
- Parameters
-
source | Target string. |
delimiter | Delimiter. |
◆ FirstFromSplit() [2/2]
static string Semi.StringExt.FirstFromSplit |
( |
this string |
source, |
|
|
string |
delimiter |
|
) |
| |
|
inlinestatic |
Gets the first element of the string if it was split by delimiter
, without actually splitting the string (and using up memory).
- Returns
- The first element, or the same string if the delimiter doesn't occur at all.
- Parameters
-
source | Target string. |
delimiter | Delimiter. |
◆ IsPureASCII()
static bool Semi.StringExt.IsPureASCII |
( |
this string |
input | ) |
|
|
inlinestatic |
Detects whether the string consists of just ASCII (0-255) characters.
- Returns
true
, if string is pure ASCII, false
otherwise.
- Parameters
-
◆ RemovePrefix()
static string Semi.StringExt.RemovePrefix |
( |
this string |
s, |
|
|
string |
prefix |
|
) |
| |
|
inlinestatic |
Removes the prefix if the string has one.
- Returns
- The string with the prefix removed, or the same string if it doesn't have the specified prefix.
- Parameters
-
s | Target string. |
prefix | Prefix string. |
◆ RemoveSuffix()
static string Semi.StringExt.RemoveSuffix |
( |
this string |
s, |
|
|
string |
suffix |
|
) |
| |
|
inlinestatic |
Removes the suffix if the string has one.
- Returns
- The string with the suffix removed, or the same string if it doesn't have the specified suffix.
- Parameters
-
s | Target string. |
suffix | Suffix string. |
◆ SplitIntoPair()
static SplitPair Semi.StringExt.SplitIntoPair |
( |
this string |
source, |
|
|
string |
delimiter |
|
) |
| |
|
inlinestatic |
Splits a string into a pair of the first element and everything past the first delimiter.
- Returns
- The string pair.
- Parameters
-
source | Target string. |
delimiter | Delimiter. |
◆ StartsWithInvariant()
static bool Semi.StringExt.StartsWithInvariant |
( |
this string |
s, |
|
|
string |
v, |
|
|
bool |
ignore_case = false |
|
) |
| |
|
inlinestatic |
Quality of life extension method to check whether a string starts with another string using invariant culture.
- Returns
true
, if the string starts with the provided text, false
otherwise.
- Parameters
-
s | Target string. |
v | Prefix string to check. |
ignore_case | If set to true ignore case. |
◆ ToPlatformPath()
static string Semi.StringExt.ToPlatformPath |
( |
this string |
s | ) |
|
|
inlinestatic |
Converts Windows directory separators in a path to the appropriate one for the platform if necessary.
- Returns
- The same path if on Windows, or a path with backward slashes turned into forward slashes on other platforms.
- Parameters
-
◆ ToTitleCaseInvariant()
static string Semi.StringExt.ToTitleCaseInvariant |
( |
this string |
s | ) |
|
|
inlinestatic |
Quality of life extension method to turn the string into title case using invariant culture.
- Returns
- The string turned into title case.
- Parameters
-
The documentation for this class was generated from the following file:
- Semi/src/Extensions/String.cs