Class StringExtensions
- Namespace
- ArcanaDevelopment.adTempus.Shared
- Assembly
- ArcanaDevelopment.adTempus.Shared.dll
public static class StringExtensions
- Inheritance
-
objectStringExtensions
Methods
AppendWithSeparator(StringBuilder, string, string)
Appends a string to a StringBuilder, adding a separator if the StringBuilder is not empty.
public static void AppendWithSeparator(this StringBuilder target, string stringToAppend, string separator)
Parameters
| Name | Type | Description |
|---|---|---|
target |
StringBuilder | The StringBuilder to append to |
stringToAppend |
string | The string to append |
separator |
string | The separator to use when appending |
Remarks
This method can be used, for example, to create comma-separated lists.
TrimEnd(string, string, StringComparison)
Removes all occurrences of a given string from the end of a string.
public static string TrimEnd(this string source, string stringToTrim, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)
Parameters
| Name | Type | Description |
|---|---|---|
source |
string | |
stringToTrim |
string | |
comparisonType |
StringComparison |
Returns
- string
TrimStart(string, string, StringComparison)
Removes all occurrences of a given string from the start of a string.
public static string TrimStart(this string source, string stringToTrim, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)
Parameters
| Name | Type | Description |
|---|---|---|
source |
string | |
stringToTrim |
string | |
comparisonType |
StringComparison |
Returns
- string