SpanExtension Class

Extension methods for the Span<Char> struct.

Definition

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

Methods

ContainsIndicates whether a specified sequence of Unicode characters occurs within a character span.
ContainsNewLineIndicates whether a character span contains a newline character.
ContainsWhiteSpaceIndicates whether a character span contains a white space character.
EndsWith(SpanChar, Char)Indicates whether a character span ends with the specified Unicode character.
EndsWith(SpanChar, ReadOnlySpanChar, StringComparison)Indicates whether span ends with value when compared using a specified StringComparison value.
EqualsDetermines whether this span and other have the same characters when compared using the specified comparisonType option.
GetPersistentHashCodeGenerates the same Int32 hash code for an identical string of characters each time the program is run.
IndexOf Reports the zero-based index of the first occurrence of the specified value in the current span.
IsAsciiChecks whether the character span contains only Unicode characters that belong to the ASCII character set.
IsWhiteSpaceIndicates whether the character span contains only white space characters.
LastIndexOf(SpanChar, ReadOnlySpanChar, StringComparison)Specifies the zero-based index of the last occurrence of a specified character sequence in span. A parameter specifies the type of search for the specified character sequence.
LastIndexOf(SpanChar, ReadOnlySpanChar, Int32, Int32, StringComparison)Specifies the zero based index position of the last occurrence of a specified character sequence in span. The search begins at a specified character position and runs backwards to the beginning of the character span for a specified number of character positions. A parameter specifies the type of comparison to be performed when searching for the specified character sequence.
LastIndexOfAny(SpanChar, SearchValuesPolyfillChar, Int32, Int32)Returns the zero-based index of the last occurrence of one of the specified characters in span. The search begins at a specified character position and runs a specified number of character positions backwards to the beginning of the span.
LastIndexOfAny(SpanChar, ReadOnlySpanChar, Int32, Int32)Returns the zero-based index of the last occurrence of one of the specified characters in span. The search begins at a specified character position and runs a specified number of character positions backwards to the beginning of the span.
StartsWith(SpanChar, Char)Indicates whether span starts with the specified character.
StartsWith(SpanChar, ReadOnlySpanChar, StringComparison)Indicates whether a character span starts with value when compared using a specified StringComparison value.
ToLowerInvariantConverts the letters that span references to lowercase letters using the rules of the invariant culture.
ToUpperInvariantConverts the letters that span references to uppercase letters using the rules of the invariant culture.
Trim Removes all leading and trailing occurrences of a set of characters specified in a SearchValuesPolyfill<Char> instance from a character span.
TrimEnd Removes all trailing occurrences of a set of characters specified in a SearchValuesPolyfill<Char> instance from a character span.
TrimStart Removes all leading occurrences of a set of characters specified in a SearchValuesPolyfill<Char> instance from a character span.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also