GCCHigh.Extensions.String contains String extension methods for C# specifically targeted to the GCCHigh M365 environment. GCCHigh.Extensions supports all versions of.NET from 4.6.2 through 8.0.
The following classes have been extended:
- System.String
with these methods:
Checks if the current string begins with the given target string.
For example:
"GCCHigh.Extensions rock!".BeginsWith("GCCHigh")
will return
true
whereas
"GCCHigh.Extensions rock!".BeginsWith("gcchigh")
will also return
true
because the ignorecase switch defaults to true. Using the
ignorecase switch like this
"GCCHigh.Extensions rock!".BeginsWith("gcchigh", false)
will return
false
Checks if the given string contains any of the characters or strings
provided in the IEnumerable.
This is useful for validating a given set of characters, like
special characters, or a given set of string, like bad words, is
not present in the target string.
Checks if the given string contains only the characters or strings
provided in the IEnumerable.
This is useful for validating a string contains only hex chars etc.
Return the given string encased in double quotes. This is useful
when working with multi-layer quotes and strings where strings
contain quoted strings.
Encode a given string as XML by encoding all ampersand, single
quote, greater than, less than and double quote characters into
their proper XML equivalent.