ReadOnlySpanPolyfillExtension Class

Extension methods for the ReadOnlySpan<Char> struct, which are used as polyfills for methods from current .NET versions.

Definition

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

Remarks

The methods of this class should only be used in the extension method syntax to simulate the methods of the ReadOnlySpan<Char> struct, which exist in more modern frameworks.

Methods

CommonPrefixLength(ReadOnlySpanChar, ReadOnlySpanChar)Determines the length of any common prefix shared between span and other.
CommonPrefixLength(ReadOnlySpanChar, String)Determines the length of any common prefix shared between span and other.
CommonPrefixLength(ReadOnlySpanChar, ReadOnlySpanChar, IEqualityComparerChar)Determines the length of any common prefix shared between span and other.
CommonPrefixLength(ReadOnlySpanChar, String, IEqualityComparerChar)Determines the length of any common prefix shared between span and other.
Contains(ReadOnlySpanChar, Char)Indicates whether a read-only character span contains the Unicode character that is passed to the method as argument.
Contains(ReadOnlySpanChar, String, StringComparison)Indicates whether a specified value occurs within a read-only character span.
ContainsAny(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for an occurrence of any of the specified characters and returns true if found. If not found, returns false.
ContainsAny(ReadOnlySpanChar, ReadOnlySpanChar)Indicates whether a read-only span of Unicode characters contains one of the Unicode characters that are passed to the method in another span.
ContainsAny(ReadOnlySpanChar, String)Indicates whether a read-only character span contains one of the Unicode characters that are passed to the method as a string.
ContainsAny(ReadOnlySpanChar, Char, Char)Indicates whether a read-only character span contains one of the two characters that are passed to the method as arguments.
ContainsAny(ReadOnlySpanChar, Char, Char, Char)Indicates whether a character span contains one of the three characters that are passed to the method as arguments.
ContainsAnyExcept(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for any character other than the specified values.
ContainsAnyExcept(ReadOnlySpanChar, Char)Searches for any character other than value.
ContainsAnyExcept(ReadOnlySpanChar, ReadOnlySpanChar)Searches for any character other than the specified values.
ContainsAnyExcept(ReadOnlySpanChar, String)Searches for any character other than the specified values.
ContainsAnyExcept(ReadOnlySpanChar, Char, Char)Searches for any character other than value0 or value1.
ContainsAnyExcept(ReadOnlySpanChar, Char, Char, Char)Indicates whether a character span contains one of the three characters that are passed to the method as arguments.
ContainsAnyInRange Searches for any value in the range between lowInclusive and highInclusive, inclusive.
EndsWith(ReadOnlySpanChar, Char)Indicates whether a read-only character span ends with a specified Unicode character.
EndsWith(ReadOnlySpanChar, String)Indicates whether span ends with the specified String.
EndsWith(ReadOnlySpanChar, String, StringComparison)Indicates whether a read-only character span ends with a specified String when compared using a specified StringComparison value.
EnumerateLines(ReadOnlySpanChar) Returns an enumeration of lines over the provided span.
EnumerateLines(SpanChar) Returns an enumeration of lines over the provided span.
EqualsDetermines whether this span and the specified other other String have the same characters when compared using the specified comparisonType option.
IndexOf Reports the zero-based index of the first occurrence of the specified value in the current span.
IndexOfAny(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for the zero-based index of the first occurrence of one of the specified Unicode characters.
IndexOfAny(ReadOnlySpanChar, ReadOnlySpanChar)Searches for the zero-based index of the first occurrence of one of the specified Unicode characters.
IndexOfAny(ReadOnlySpanChar, String)Searches for the zero-based index of the first occurrence of one of the specified Unicode characters.
IndexOfAnyExcept(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for the first index of any character other than the specified values.
IndexOfAnyExcept(ReadOnlySpanChar, Char)Returns the index of the first character in the read-only span that is not equal to value.
IndexOfAnyExcept(ReadOnlySpanChar, ReadOnlySpanChar) Searches for the first index of any character other than the specified values.
IndexOfAnyExcept(ReadOnlySpanChar, String) Searches for the first index of any character other than the specified values.
IndexOfAnyExcept(ReadOnlySpanChar, Char, Char) Searches for the first index of any character other than the specified value0 or value1.
IndexOfAnyExcept(ReadOnlySpanChar, Char, Char, Char) Searches for the first index of any character other than the specified value0, value1, or value2.
IndexOfAnyExceptInRange Searches for the first index of any value outside of the range between lowInclusive and highInclusive, inclusive.
IndexOfAnyInRange Searches for the first index of any value in the range between lowInclusive and highInclusive, inclusive.
LastIndexOf(ReadOnlySpanChar, ReadOnlySpanChar, StringComparison)Specifies the zero-based index of the last occurrence of a specified string in span. A parameter specifies the type of search for the specified string.
LastIndexOf(ReadOnlySpanChar, String, StringComparison)Specifies the zero-based index of the last occurrence of a specified string in span. A parameter specifies the type of search for the specified string.
LastIndexOfAny(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for the last index of any of the specified Unicode characters.
LastIndexOfAny(ReadOnlySpanChar, ReadOnlySpanChar)Searches for the zero-based index of the last occurrence of one of the specified Unicode characters.
LastIndexOfAny(ReadOnlySpanChar, String)Searches for the zero-based index of the last occurrence of one of the specified Unicode characters.
LastIndexOfAnyExcept(ReadOnlySpanChar, SearchValuesPolyfillChar) Searches for the last index of any character other than the specified values.
LastIndexOfAnyExcept(ReadOnlySpanChar, Char)Returns the index of the last character in the read-only span that is not equal to value.
LastIndexOfAnyExcept(ReadOnlySpanChar, ReadOnlySpanChar) Searches for the last index of any character other than the specified values.
LastIndexOfAnyExcept(ReadOnlySpanChar, String) Searches for the last index of any character other than the specified values.
LastIndexOfAnyExcept(ReadOnlySpanChar, Char, Char) Searches for the last index of any character other than the specified value0 or value1.
LastIndexOfAnyExcept(ReadOnlySpanChar, Char, Char, Char) Searches for the last index of any character other than the specified value0, value1, or value2.
LastIndexOfAnyExceptInRange Searches for the last index of any value outside of the range between lowInclusive and highInclusive, inclusive.
LastIndexOfAnyInRange Searches for the last index of any value in the range between lowInclusive and highInclusive, inclusive.
StartsWith(ReadOnlySpanChar, Char)Indicates whether a read-only character span begins with the specified Unicode character.
StartsWith(ReadOnlySpanChar, String)Indicates whether a read-only span of characters starts with the specified String.
StartsWith(ReadOnlySpanChar, String, StringComparison)Indicates whether a read-only character span begins with a specified String when compared using a specified StringComparison value.
Trim Removes all leading and trailing occurrences of a set of characters specified in a String from a read-only character span.
TrimEnd Removes all trailing occurrences of a set of characters specified in a String from a read-only character span.
TrimStart Removes all leading occurrences of a set of characters specified in a String from a read-only character span.

See Also