StringUtil Class |
Namespace: Nova.Utilities
public static class StringUtil
The StringUtil type exposes the following members.
Name | Description | |
---|---|---|
Append |
Append one string to another, using an optional separator string if the destination string isn't empty.
Treats both destination and source strings as empty if null.
| |
CharCount |
Return the number of consecutive specified chars at the specified starting index.
| |
Contains(String, Char) |
Check if the string contains the specified character, returning false if the string is null.
| |
Contains(String, String) |
Check if the specified string array contains the specified string.
| |
ContainsIgnoreCase |
Check if the string contains the specified substring using a case-insensitive compare, returning false if the string is null.
| |
ConvertUnicodeEscapes |
Convert all unicode escape sequences in the specified string that represent letters or digits into chars.
| |
EmptyAsNull |
Return null if the string is empty, otherwise leave it unchanged.
| |
ExpandEnvironmentMacros |
Expand any $(NAME) or %NAME% macros in the specified string with environment variable values.
| |
IsEmpty |
Check if the specified string is empty, blank, or null.
| |
NNEquals |
Compare if one string equals another, ignoring leading/trailing whitespace, and
treating null and empty strings as equivalent.
| |
NNEqualsIgnoreCase |
Compare if one string equals another, ignoring case and leading/trailing whitespace, and
treating null and empty strings as equivalent.
| |
NNLength |
Get the length of the specified string, or 0 if it's null.
| |
NNTrim |
Trim whitespace from both ends of the specified string, returning an empty string if the string is null.
| |
NormalizeWhitespace |
Convert all runs of spaces and tabs to a single space, and trim all leading and trailing whitespace.
| |
NotEmpty |
Check if the specified string is NOT empty, blank, or null.
| |
NotNull |
Convert a string to an empty string if it's null.
| |
ParseT(String) |
Convert a string to a generic value.
| |
ParseT(String, T) |
Convert a string to a generic value.
| |
ParseArrayT(String, T) |
Convert a comma delimited string to an array of generic values
| |
ParseArrayT(String, T, Char) |
Convert a comma delimited string to an array of generic values
| |
ParseBool(String) |
Convert a string to a bool, returning false if the string is null or isn't a valid bool value.
| |
ParseBool(String, Boolean) |
Convert a string to a bool, returning a default value if the string is null or isn't a valid bool value.
| |
ParseDateTime(String) |
Convert a string to a DateTime, returning DateTime.MinValue if the string is null or isn't a valid DateTime value.
| |
ParseDateTime(String, DateTime) |
Convert a string to a DateTime, returning a default value if the string is null or isn't a valid DateTime value.
| |
ParseDouble(String) |
Convert a string to a double, defaulting to 0 if the string is null or isn't a valid double value.
| |
ParseDouble(String, Double) |
Convert a string to a double, returning a default value if the string is null or isn't a valid double value.
| |
ParseEnumT |
Convert a string to an enum value, returning a default value if the string is null or isn't a valid enum value.
| |
ParseGuid |
Convert a string to a Guid.
| |
ParseInt(String) |
Convert a string to an int, defaulting to 0 if the string is null or isn't a valid integer value.
| |
ParseInt(String, Int32) |
Convert a string to an int, returning a default value if the string is null or isn't a valid integer value.
| |
ToString |
Format the specified collection into a single string using the specified separating
string to separate each item. Null items are converted to empty strings.
|