NamespaceSystemLibrary.Common.Net.Extensions SystemLibrary.Common.Net.dll
String Builder extensions
StringBuilderExtensions
public static class StringBuilderExtensions
Inheritance
System.Object
StringBuilderExtensions
Examples
Arguments
X
Methods
Returns true if stringbuilder ends with a certain text, else false
- does not throw exception on null
- pass flag for case sensitivity
public static bool EndsWith(this StringBuilder stringBuilder, string ending, bool caseInsensitive = false)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringBuilder | |
System.String | ending | |
System.Boolean | caseInsensitive |
X
Type | Description |
---|---|
System.Boolean |
public static void HtmlDecodeQuotes(this StringBuilder html, Dictionary<string, string> additionalReplacements = null)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | html | |
System.Collections.Generic.Dictionary<System.String, System.String> | additionalReplacements |
public static void HtmlEncodeQuotes(this StringBuilder html, Dictionary<string, string> additionalReplacements = null)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | html | |
System.Collections.Generic.Dictionary<System.String, System.String> | additionalReplacements |
Returns the index of the text within the StringBuilder or -1 if not found
public static int IndexOf(this StringBuilder stringBuilder, string text, bool ignoreCase = false, int start = 0)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringBuilder | |
System.String | text | The string to find |
System.Boolean | ignoreCase | if set to |
System.Int32 | start | The starting index. |
X
Type | Description |
---|---|
System.Int32 |
Returns true if the string builder is not null and has a text length greater than 0
public static bool Is(this StringBuilder stringBuilder)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringBuilder |
X
Type | Description |
---|---|
System.Boolean |
Returns true if string builder is null or is empty
public static bool IsNot(this StringBuilder stringBuilder)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringBuilder |
X
Type | Description |
---|---|
System.Boolean |
Removes the ending of the text inside the stringbuilder, if it matches the 'ending'
Returns true if a text was removed, else false
public static bool TrimEnd(this StringBuilder stringBuilder, params string[] values)
X
Methods arguments
Type | Name | Description |
---|---|---|
System.Text.StringBuilder | stringBuilder | |
System.String[] | values |
X
Type | Description |
---|---|
System.Boolean |
}