StringExtension Class

Extension methods for the String class.

Definition

Namespace: FolkerKinzel.Strings
Assembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
C#
public static class StringExtension
Inheritance
Object    StringExtension

Methods

ContainsAny(String, Char)Indicates whether a String contains one of the Unicode characters that are passed to the method as an array.
ContainsAny(String, ReadOnlySpanChar)Indicates whether a String contains one of the Unicode characters that are passed to the method in a read-only span.
ContainsAny(String, Char, Char)Indicates whether a String contains one of the two characters that are passed to the method as arguments.
ContainsAny(String, Char, Char, Char)Indicates whether a String contains one of the 3 characters that are passed to the method as arguments.
ContainsNewLineIndicates whether the String contains a newline character.
ContainsWhiteSpaceIndicates whether a String contains white space.
GetPersistentHashCodeGenerates the same Int32 hash code for an identical string of characters each time the program is run.
IndexOfAny(String, ReadOnlySpanChar)Returns the zero-based index of the first occurrence of one of the the specified characters in s.
IndexOfAny(String, ReadOnlySpanChar, Int32)Returns the zero-based index of the first occurrence of one of the the specified characters in s. The search starts at the specified startIndex.
IndexOfAny(String, ReadOnlySpanChar, Int32, Int32)Returns the zero-based index of the first occurrence of one of the the specified characters in s. The search begins at a specified index and a specified number of character positions are checked.
IsAsciiIndicates whether the String contains Unicode characters that do not belong to the ASCII character set.
LastIndexOfAny(String, ReadOnlySpanChar)Returns the zero-based index position of the last occurrence of one of the specified characters in s.
LastIndexOfAny(String, ReadOnlySpanChar, Int32)Returns the zero-based index position of the last occurrence of one of the specified characters in s. The search starts at the specified startIndex and runs backwards to the beginning of s.
LastIndexOfAny(String, ReadOnlySpanChar, Int32, Int32)Returns the zero-based index position of the last occurrence of one of the specified characters in s. The search begins at a specified index and runs backwards to the beginning of the String for a specified number of character positions.
ReplaceWhiteSpaceWithGenerates a String in which all sequences of white space are replaced by replacement.

Thread Safety

Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.

See Also