MemoryExtensions Class

Provides extensions for the ReadOnlyMemory<T> and ReadOnlySpan<T> structures.

Definition

Namespace: Ookii.Common
Assembly: Ookii.Common (in Ookii.Common.dll) Version: 1.0.0+7c2900b8a16cd8ae46bdd79d8f105034712c5fa3
C#
public static class MemoryExtensions
Inheritance
Object    MemoryExtensions

Methods

Split(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, StringSplitOptions) Splits a string memory region into segments using the specified separator.
Split(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringSplitOptions) Splits a string span into segments using the specified separator.
SplitAt<T>(ReadOnlyMemory<T>, Int32, Int32) Splits a ReadOnlyMemory<T> into two parts at the specified index, optionally skipping the specified number of elements.
SplitAt<T>(ReadOnlySpan<T>, Int32, Int32) Splits a ReadOnlySpan<T> into two parts at the specified index, optionally skipping the specified number of elements.
SplitOnce(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, StringComparison) Splits a read-only memory region of characters into two parts at the first occurrence of a separator.
SplitOnce(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Splits a span of characters into two parts at the first occurrence of a separator.
SplitOnce(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Splits a read-only memory region of characters into two parts at the first occurrence of a separator.
SplitOnce(ReadOnlySpan<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Splits a span of characters into two parts at the first occurrence of a separator.
SplitOnce<T>(ReadOnlyMemory<T>, T) Splits a ReadOnlyMemory<T> into two parts at the first occurrence of a separator.
SplitOnce<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Splits a ReadOnlyMemory<T> into two parts at the first occurrence of a separator.
SplitOnce<T>(ReadOnlySpan<T>, T) Splits a ReadOnlySpan<T> into two parts at the first occurrence of a separator.
SplitOnce<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Splits a ReadOnlySpan<T> into two parts at the first occurrence of a separator.
SplitOnceAny<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Splits a ReadOnlyMemory<T> into two parts at the first occurrence of any of the specified separators.
SplitOnceAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Splits a ReadOnlySpan<T> into two parts at the first occurrence of any of the specified separators.
SplitOnceLast(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, StringComparison) Splits a read-only memory region of characters into two parts at the last occurrence of a separator.
SplitOnceLast(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Splits a span of characters into two parts at the last occurrence of a separator.
SplitOnceLast(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Splits a read-only memory region of characters into two parts at the first occurrence of a separator.
SplitOnceLast(ReadOnlySpan<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Splits a span of characters into two parts at the last occurrence of a separator.
SplitOnceLast<T>(ReadOnlyMemory<T>, T) Splits a ReadOnlyMemory<T> into two parts at the last occurrence of a separator.
SplitOnceLast<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Splits a ReadOnlyMemory<T> into two parts at the last occurrence of a separator.
SplitOnceLast<T>(ReadOnlySpan<T>, T) Splits a ReadOnlySpan<T> into two parts at the last occurrence of a separator.
SplitOnceLast<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Splits a ReadOnlySpan<T> into two parts at the first occurrence of a separator.
SplitOnceLastAny<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Splits a ReadOnlyMemory<T> into two parts at the last occurrence of any of the specified separators.
SplitOnceLastAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Splits a ReadOnlySpan<T> into two parts at the last occurrence of any of the specified separators.
StripPrefix(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, StringComparison) Removes a prefix from a read-only memory region of characters.
StripPrefix(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Removes a prefix from a span of characters.
StripPrefix(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Removes a prefix from a read-only memory region of characters.
StripPrefix(ReadOnlySpan<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Removes a prefix from a span of characters.
StripPrefix<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Removes a prefix from a ReadOnlyMemory<T>.
StripPrefix<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Removes a prefix from a ReadOnlySpan<T>.
StripSuffix(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, StringComparison) Removes a suffix from a read-only memory region of characters.
StripSuffix(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Removes a suffix from a span of characters.
StripSuffix(ReadOnlyMemory<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Removes a suffix from a read-only memory region of characters.
StripSuffix(ReadOnlySpan<Char>, ReadOnlySpan<Char>, CultureInfo, CompareOptions) Removes a suffix from a span of characters.
StripSuffix<T>(ReadOnlyMemory<T>, ReadOnlySpan<T>) Removes a suffix from a ReadOnlyMemory<T>.
StripSuffix<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Removes a suffix from a ReadOnlySpan<T>.

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