|
Joutsen
v0.4.1
|
A static class containing extensions for the String class. More...
Static Public Member Functions | |
| static string | FormatWith (this string format, Map< String, Object > values) |
| An extension method that formats a String with named placeholders. More... | |
| static string | FormatWith (this string format, object values) |
| An extension method that formats a String with named placeholders. More... | |
| static string | FormatWith (this string format, params object[] values) |
| An extension method that formats a String with named placeholders. More... | |
| static bool | StartsWithAny (this string value, SCG.IEnumerable< String > prefixes) |
| Checks if a String starts with one of a list of substrings. More... | |
| static bool | StartsWithAny (this string value, SCG.IEnumerable< String > prefixes, StringComparison option) |
| Checks if a String starts with one of a list of substrings. More... | |
| static bool | EndsWithChar (this string value, char c, StringComparison comparison) |
Checks if value ends with the character provided by c taking the comparison options into account. More... | |
| static bool | EndsWithChar (this string value, char c) |
Checks if value ends exactly with the character provided by c. More... | |
| static String | ReplaceMany (this String input, SCG.IEnumerable< Tuple< String, String >> replacements) |
Replaces all the occurences of keys of replacements in input with the corresponding values. More... | |
| static String | ReplaceMany (this String input, SCG.IEnumerable< SCG.KeyValuePair< String, String >> replacements) |
Replaces all the occurences of keys of replacements in input with the corresponding values. More... | |
| static String | ReplaceMany (this String input, SCG.IEnumerable< Tuple< Char, Char >> replacements) |
Replaces all the occurences of keys of replacements in input with the corresponding values. More... | |
| static String | ReplaceMany (this String input, SCG.IEnumerable< SCG.KeyValuePair< Char, Char >> replacements) |
Replaces all the occurences of keys of replacements in input with the corresponding values. More... | |
| static String | ConvertCharToLowerCase (this String value, int charIndex) |
| Converts a single character in a String to lower case. More... | |
| static String | ConvertCharToUpperCase (this String value, int charIndex) |
| Converts a single character in a String to upper case. More... | |
| static bool | IsNumeric (this String stringValue) |
| Checks if a string contains only of number characters. More... | |
| static String | NormalizeToNonCombining (this String stringValue) |
| Normalizes the string to a form that does no longer include combining characters like Umlaute or Accents. More... | |
| static String | NormalizeForSearch (this String stringValue) |
| Normalizes the string to a form that does no longer include diacritics or special characters. More... | |
A static class containing extensions for the String class.
|
static |
Converts a single character in a String to lower case.
| value | the String value to modify |
| charIndex | the index of the character in value that is to be converted |
charIndex | System.ArgumentException | if charIndex is smaller than zero or bigger than the input value |
charIndex is already in lower case or is not a letter that can be converted to lower case the unmodified value is returned.
|
static |
Converts a single character in a String to upper case.
| value | the String value to modify |
| charIndex | the index of the character in value that is to be converted |
charIndex | System.ArgumentException | if charIndex is smaller than zero or bigger than the input value |
charIndex is already in upper case or is not a letter that can be converted to upper case the unmodified value is returned.
|
static |
Checks if value ends with the character provided by c taking the comparison options into account.
| value | the String value whose last character is to be checked |
| c | the character to check for |
| comparison | options for the comparison of the characters |
value value matches c, otherwise false
|
static |
Checks if value ends exactly with the character provided by c.
| value | the String value whose last character is to be checked |
| c | the character to check for |
value is c, otherwise false
|
static |
An extension method that formats a String with named placeholders.
| format | The format String containing named placeholders |
| values | Pairs of name and value where each name is a placeholder that will be replaced with the corresponding value |
values dictionary that is associated with the key <name>. All additional formats that supported by System.String.Format are supported.
|
static |
An extension method that formats a String with named placeholders.
| format | The format String containing named placeholders |
| values | An System.Object where each property name used as a placeholder in the format String will be replaced with the properties value |
values object's property <name>. All additional formats that are supported by System.String.Format are supported.
|
static |
An extension method that formats a String with named placeholders.
| format | The format String containing named placeholders |
| values | The objects that are filled into the format string according to their index in the array |
|
static |
Checks if a string contains only of number characters.
|
static |
Normalizes the string to a form that does no longer include diacritics or special characters.
|
static |
Normalizes the string to a form that does no longer include combining characters like Umlaute or Accents.
|
static |
Replaces all the occurences of keys of replacements in input with the corresponding values.
| input | the String whose substrings will be replaced |
| replacements | a list of replacements as tuples where the first value is the match that is searched for in in input and the second value is the replacement for that substring |
replacements replaced | System.ArgumentNullException | if input, replacements or one of the keys or values in replacements is null |
replacements will be processed sequntially, replacing all occurences of one entry at a time before replacing occurences of the next entry. This can lead to side effects if the replacements also match the keys of later entries. It is also possible to use the same key twice which might cause the second occurence to have no effect at all. The caller needs to take care of these side effects.
|
static |
Replaces all the occurences of keys of replacements in input with the corresponding values.
| input | the String whose substrings will be replaced |
| replacements | a list of replacements as key value pairs where the key is the match that is searched for in in input and the second value is the replacement for that substring |
replacements replaced | System.ArgumentNullException | if input, replacements or one of the keys or values in replacements is null |
replacements will be processed sequntially, replacing all occurences of one entry at a time before replacing occurences of the next entry. This can lead to side effects if the replacements also match the keys of later entries. It is also possible to use the same key twice which might cause the second occurence to have no effect at all. The caller needs to take care of these side effects.
|
static |
Replaces all the occurences of keys of replacements in input with the corresponding values.
| input | the String whose substrings will be replaced |
| replacements | a list of replacements as tuples where the first value is the match that is searched for in in input and the second value is the replacement for that character |
replacements replaced | System.ArgumentNullException | if input, replacements or one of the keys or values in replacements is null |
replacements will be processed sequntially, replacing all occurences of one entry at a time before replacing occurences of the next entry. This can lead to side effects if the replacements also match the keys of later entries. It is also possible to use the same key twice which might cause the second occurence to have no effect at all. The caller needs to take care of these side effects.
|
static |
Replaces all the occurences of keys of replacements in input with the corresponding values.
| input | the String whose characters will be replaced |
| replacements | a list of replacements as key value pairs where the key is the match that is searched for in in input and the second value is the replacement for that character |
replacements replaced | System.ArgumentNullException | if input, replacements or one of the keys or values in replacements is null |
replacements will be processed sequntially, replacing all occurences of one entry at a time before replacing occurences of the next entry. This can lead to side effects if the replacements also match the keys of later entries. It is also possible to use the same key twice which might cause the second occurence to have no effect at all. The caller needs to take care of these side effects.
|
static |
Checks if a String starts with one of a list of substrings.
| value | The String that is checked for prefixes |
| prefixes | A number of Strings that value is checked for |
prefixes is the substring that value starts with, otherwise false
|
static |
Checks if a String starts with one of a list of substrings.
| value | The String that is checked for prefixes |
| prefixes | A number of Strings that value is checked for |
| option | Options for the comparison of the prefix Strings |
prefixes is the substring that value starts with, otherwise false
1.8.13