Click or drag to resize

StringUtil Class

Extension methods for the String class.
Inheritance Hierarchy
SystemObject
  Nova.UtilitiesStringUtil

Namespace:  Nova.Utilities
Assembly:  Nova.CodeDOM (in Nova.CodeDOM.dll) Version: 7.44.8391.13415
Syntax
C#
public static class StringUtil

The StringUtil type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAppend
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.
Public methodStatic memberCharCount
Return the number of consecutive specified chars at the specified starting index.
Public methodStatic memberContains(String, Char)
Check if the string contains the specified character, returning false if the string is null.
Public methodStatic memberContains(String, String)
Check if the specified string array contains the specified string.
Public methodStatic memberContainsIgnoreCase
Check if the string contains the specified substring using a case-insensitive compare, returning false if the string is null.
Public methodStatic memberConvertUnicodeEscapes
Convert all unicode escape sequences in the specified string that represent letters or digits into chars.
Public methodStatic memberEmptyAsNull
Return null if the string is empty, otherwise leave it unchanged.
Public methodStatic memberExpandEnvironmentMacros
Expand any $(NAME) or %NAME% macros in the specified string with environment variable values.
Public methodStatic memberIsEmpty
Check if the specified string is empty, blank, or null.
Public methodStatic memberNNEquals
Compare if one string equals another, ignoring leading/trailing whitespace, and treating null and empty strings as equivalent.
Public methodStatic memberNNEqualsIgnoreCase
Compare if one string equals another, ignoring case and leading/trailing whitespace, and treating null and empty strings as equivalent.
Public methodStatic memberNNLength
Get the length of the specified string, or 0 if it's null.
Public methodStatic memberNNTrim
Trim whitespace from both ends of the specified string, returning an empty string if the string is null.
Public methodStatic memberNormalizeWhitespace
Convert all runs of spaces and tabs to a single space, and trim all leading and trailing whitespace.
Public methodStatic memberNotEmpty
Check if the specified string is NOT empty, blank, or null.
Public methodStatic memberNotNull
Convert a string to an empty string if it's null.
Public methodStatic memberParseT(String)
Convert a string to a generic value.
Public methodStatic memberParseT(String, T)
Convert a string to a generic value.
Public methodStatic memberParseArrayT(String, T)
Convert a comma delimited string to an array of generic values
Public methodStatic memberParseArrayT(String, T, Char)
Convert a comma delimited string to an array of generic values
Public methodStatic memberParseBool(String)
Convert a string to a bool, returning false if the string is null or isn't a valid bool value.
Public methodStatic memberParseBool(String, Boolean)
Convert a string to a bool, returning a default value if the string is null or isn't a valid bool value.
Public methodStatic memberParseDateTime(String)
Convert a string to a DateTime, returning DateTime.MinValue if the string is null or isn't a valid DateTime value.
Public methodStatic memberParseDateTime(String, DateTime)
Convert a string to a DateTime, returning a default value if the string is null or isn't a valid DateTime value.
Public methodStatic memberParseDouble(String)
Convert a string to a double, defaulting to 0 if the string is null or isn't a valid double value.
Public methodStatic memberParseDouble(String, Double)
Convert a string to a double, returning a default value if the string is null or isn't a valid double value.
Public methodStatic memberParseEnumT
Convert a string to an enum value, returning a default value if the string is null or isn't a valid enum value.
Public methodStatic memberParseGuid
Convert a string to a Guid.
Public methodStatic memberParseInt(String)
Convert a string to an int, defaulting to 0 if the string is null or isn't a valid integer value.
Public methodStatic memberParseInt(String, Int32)
Convert a string to an int, returning a default value if the string is null or isn't a valid integer value.
Public methodStatic memberToString
Format the specified collection into a single string using the specified separating string to separate each item. Null items are converted to empty strings.
Top
See Also