Click or drag to resize

StringExtensions Methods

The StringExtensions type exposes the following members.

Methods
  Name Description
Public Extension Method Base64Decode Decodes a given base-64 encoded string encoded with Base64Encode(String).
Public Extension Method Base64Encode Encodes a string into a base-64 string.
Public Extension Method CenterText(String, Int32) Centers text within the specified maximum length, biased to the left. Text will be padded to the left and right with spaces. If value is greater than specified maximum length, value returned will be truncated from the right.
Public Extension Method CenterText(String, Int32, Char) Centers text within the specified maximum length, biased to the left. Text will be padded to the left and right with specified padding character. If value is greater than specified maximum length, value returned will be truncated from the right.
Public Extension Method CharCount Counts the total number of the occurrences of a character in the given string.
Public Extension Method ConvertToType(String, Type) Converts this string into the specified type.
Public Extension Method ConvertToType(String, Type, CultureInfo) Converts this string into the specified type.
Public Extension Method ConvertToTypeT(String) Converts this string into the specified type.
Public Extension Method ConvertToTypeT(String, CultureInfo) Converts this string into the specified type.
Public Extension Method EnsureEnd(String, Char) Ensures a string ends with a specific character.
Public Extension Method EnsureEnd(String, String) Ensures a string ends with a specific string.
Public Extension Method EnsureEnd(String, Char, Boolean) Ensures a string ends with a specific character.
Public Extension Method EnsureStart(String, Char) Ensures a string starts with a specific character.
Public Extension Method EnsureStart(String, String) Ensures a string starts with a specific string.
Public Extension Method EnsureStart(String, Char, Boolean) Ensures a string starts with a specific character.
Public Extension Method GetComparer Gets appropriate StringComparer for the specified StringComparison.
Public Extension Method GetSegments Turns source string into an array of string segments - each with a set maximum width - for parsing or displaying.
Public Extension Method IndexOfNot(String, Char, Int32) Finds the first index that does not match the given character.
Public Extension Method IndexOfNot(String, Char, Int32) Finds the first index that is NOT included in testChars
Public Extension Method IndexOfNot(String, FuncChar, Boolean, Int32) Finds the first index that does NOT pass the characterTestFunction delegate function.
Public Extension Method IndexOfPrevious(String, Char, Int32) Searches a string from right to left for the next instance of a specified character.
Public Extension Method IndexOfPrevious(String, FuncChar, Boolean, Int32) Searches a string from right to left for the next instance of a character passing the specified delegate.
Public Extension Method IndexOfPrevious(String, String, Int32, Boolean) Searches a string from right to left for the next instance of a specified string.
Public Extension Method IndexOfPreviousNot(String, Char, Int32) Searches a string from right to left for the next instance of a character that is not the specified character.
Public Extension Method IndexOfPreviousNot(String, Char, Int32) Searches a string from right to left for the next instance of a character that is not contained in the specified collection of characters.
Public Extension Method IndexOfPreviousNot(String, FuncChar, Boolean, Int32) Searches a string from right to left for the next instance of a character that does not pass the given delegate function.
Public Extension Method IndexOfRepeatedChar(String) Searches a string for an instance of a repeated character.
Public Extension Method IndexOfRepeatedChar(String, Char) Searches a string for a repeated instance of the specified characterToFind.
Public Extension Method IndexOfRepeatedChar(String, Int32) Searches a string for an instance of a repeated character from specified startIndex.
Public Extension Method IndexOfRepeatedChar(String, Char, Int32) Searches a string for a repeated instance of the specified characterToFind from specified startIndex.
Public Extension Method Interpolate(String, IEnumerableKeyValuePairString, Object) Applies string interpolation to the given format string at runtime.
Public Extension Method InterpolateT(String, T) Applies string interpolation to the given format string at runtime.
Public Extension Method IsAllDigits Tests to see if a string is contains only digits based on Char.IsDigit function.
Public Extension Method IsAllLetters(String) Tests to see if a string contains only letters.
Public Extension Method IsAllLetters(String, Boolean) Tests to see if a string contains only letters.
Public Extension Method IsAllLettersOrDigits(String) Tests to see if a string contains only letters or digits.
Public Extension Method IsAllLettersOrDigits(String, Boolean) Tests to see if a string contains only letters or digits.
Public Extension Method IsAllLower Tests to see if a string's letters are all lower case.
Public Extension Method IsAllNumbers Tests to see if a string contains only numbers based on Char.IsNumber function.
Public Extension Method IsAllUpper Tests to see if a string's letters are all upper case.
Public Extension Method IsNullOrWhiteSpace Test to see if the provided string is null or contains only whitespace characters.
Public Extension Method IsPlural Determines whether the specified word is plural.
Public Extension Method IsSingular Determines whether the specified word is singular.
Public Extension Method JoinKeyValuePairs Combines a dictionary of key-value pairs in to a string.
Public Extension Method NotEmpty(String) Ensures parameter is not an empty or null string. Returns a single space if test value is empty.
Public Extension Method NotEmpty(String, String) Ensures parameter is not an empty or null string.
Public Extension Method ParseBoolean Parses a string intended to represent a boolean value.
Public Extension Method ParseKeyValuePairs Parses key/value pair expressions from a string. Parameter pairs are delimited by keyValueDelimiter and multiple pairs separated by parameterDelimiter. Supports encapsulated nested expressions.
Public Extension Method QuoteUnwrap(String, Char) Unwraps quotes similar to Excel. However, a little more predictable for unusual edge cases.
Public Extension Method QuoteUnwrap(String, Char) Unwraps quotes similar to Excel. However, a little more predictable for unusual edge cases.
Public Extension Method QuoteWrap Wraps value in the quoteChar.
Public Extension Method RegexDecode Decodes the specified Regular Expression character back into a standard Unicode character.
Public Extension Method RemoveCharacter Removes all characters matching the given characterToRemove.
Public Extension Method RemoveCharacters Removes all characters passing delegate test from a string.
Public Extension Method RemoveControlCharacters Removes all control characters from a string.
Public Extension Method RemoveCrLfs Removes all carriage returns and line feeds from a string.
Public Extension Method RemoveDuplicates Removes duplicate character strings (adjoining replication) in a string.
Public Extension Method RemoveDuplicateWhiteSpace(String) Replaces all repeating white space with a single space.
Public Extension Method RemoveDuplicateWhiteSpace(String, Char) Replaces all repeating white space with specified spacing character.
Public Extension Method RemoveInvalidFileNameCharacters Removes all invalid file name characters (\ / : * ? " < > |) from a string.
Public Extension Method RemoveLeadingString(String, Char, Boolean) Removes one or more instances of a specified char from the beginning of a string.
Public Extension Method RemoveLeadingString(String, String, Boolean) Removes one or more instances of a specified string from the beginning of a string.
Public Extension Method RemoveLeadingZeros Assures that numeric value is a well formed number Adds a leading zero in front of a decimal, if present
Public Extension Method RemoveNull Removes the terminator ('\0') from a null terminated string.
Public Extension Method RemoveTrailingString(String, Char, Boolean) Removes one or more instances of a character from the end of a string
Public Extension Method RemoveTrailingString(String, String, Boolean) Removes one or more instances of a string from the end of a string
Public Extension Method RemoveWhiteSpace Removes all white space (as defined by IsWhiteSpace) from a string.
Public Extension Method ReplaceCaseInsensitive Performs a case insensitive string replacement.
Public Extension Method ReplaceCharacters Replaces all characters passing delegate test with specified replacement character.
Public Extension Method ReplaceControlCharacters(String) Replaces all control characters in a string with a single space.
Public Extension Method ReplaceControlCharacters(String, Char) Replaces all control characters in a string with specified replacement character.
Public Extension Method ReplaceCrLfs Replaces all carriage return and line feed characters (as well as CR/LF sequences) in a string with specified replacement character.
Public Extension Method ReplaceInvalidFileNameCharacters Replaces all invalid file name characters (\ / : * ? " < > |) in a string with the specified replacementCharacter.
Public Extension Method ReplaceWhiteSpace Replaces all white space characters (as defined by IsWhiteSpace) with specified replacement character.
Public Extension Method Reverse Reverses the order of the characters in a string.
Public Extension Method StringCount Counts the total number of the occurrences of string within a string
Public Extension Method SubstringEnd Returns a string consisting of a specified number of characters from the end of a string "to the left"
Public Extension Method SubstringPrevious Returns a string consisting of a specified number of characters to the left (previous chars) from the provided startIndex
Public Extension Method ToCamelCase Converts first letter of string to lower-case.
Public Extension Method ToPascalCase Converts first letter of string to upper-case.
Public Extension Method ToPlural Returns the plural form of the specified word.
Public Extension Method ToSecureString Converts the given string into a SecureString.
Public Extension Method ToSingular Returns the singular form of the specified word.
Public Extension Method ToStream Converts string into a stream using the specified encoding.
Public Extension Method ToStreamAsync Asynchronously converts string into a stream using the specified encoding.
Public Extension Method ToTitleCase Converts the provided string into title case (upper case first letter of each word).
Public Extension Method ToUnsecureString Converts the given SecureString into a String.
Public Extension Method TrimWithEllipsisEnd Places an ellipsis at the end of a string as it is trimmed to length specified.
Public Extension Method TrimWithEllipsisMiddle Places an ellipsis in the middle of a string as it is trimmed to length specified.
Public Extension Method TruncateLeft Truncates the provided string from the left if it is longer that specified length.
Public Extension Method TruncateRight Truncates the provided string from the right if it is longer that specified length.
Public Extension Method UriEncode Escapes string using URL encoding.
Top
See Also