<PackageReference Include="System.Memory" Version="4.6.3" />

System.MemoryExtensions

public static class MemoryExtensions
Extension methods for Span{T}, Memory{T}, and friends.
namespace System { public static class MemoryExtensions { public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span); public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span); public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span); public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span, char trimChar); public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span, char trimChar); public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span, char trimChar); public static ReadOnlySpan<char> Trim(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars); public static ReadOnlySpan<char> TrimStart(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars); public static ReadOnlySpan<char> TrimEnd(this ReadOnlySpan<char> span, ReadOnlySpan<char> trimChars); public static bool IsWhiteSpace(this ReadOnlySpan<char> span); public static int IndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>; public static int IndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static int LastIndexOf<T>(this Span<T> span, T value) where T : IEquatable<T>; public static int LastIndexOf<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool SequenceEqual<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>; public static int SequenceCompareTo<T>(this Span<T> span, ReadOnlySpan<T> other) where T : IComparable<T>; public static int IndexOf<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>; public static int IndexOf<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static int LastIndexOf<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>; public static int LastIndexOf<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static int IndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>; public static int IndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>; public static int IndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>; public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>; public static int IndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>; public static int IndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>; public static int LastIndexOfAny<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>; public static bool SequenceEqual<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other) where T : IEquatable<T>; public static int SequenceCompareTo<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other) where T : IComparable<T>; public static bool StartsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool StartsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool EndsWith<T>(this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static bool EndsWith<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>; public static void Reverse<T>(this Span<T> span); public static Span<T> AsSpan<T>(this T[] array); public static Span<T> AsSpan<T>(this T[] array, int start, int length); public static Span<T> AsSpan<T>(this ArraySegment<T> segment); public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start); public static Span<T> AsSpan<T>(this ArraySegment<T> segment, int start, int length); public static Memory<T> AsMemory<T>(this T[] array); public static Memory<T> AsMemory<T>(this T[] array, int start); public static Memory<T> AsMemory<T>(this T[] array, int start, int length); public static Memory<T> AsMemory<T>(this ArraySegment<T> segment); public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start); public static Memory<T> AsMemory<T>(this ArraySegment<T> segment, int start, int length); public static void CopyTo<T>(this T[] source, Span<T> destination); public static void CopyTo<T>(this T[] source, Memory<T> destination); public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other); public static bool Overlaps<T>(this Span<T> span, ReadOnlySpan<T> other, out int elementOffset); public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other); public static bool Overlaps<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other, out int elementOffset); public static int BinarySearch<T>(this Span<T> span, IComparable<T> comparable); public static int BinarySearch<T, TComparable>(this Span<T> span, TComparable comparable) where TComparable : IComparable<T>; public static int BinarySearch<T, TComparer>(this Span<T> span, T value, TComparer comparer) where TComparer : IComparer<T>; public static int BinarySearch<T>(this ReadOnlySpan<T> span, IComparable<T> comparable); public static int BinarySearch<T, TComparable>(this ReadOnlySpan<T> span, TComparable comparable) where TComparable : IComparable<T>; public static int BinarySearch<T, TComparer>(this ReadOnlySpan<T> span, T value, TComparer comparer) where TComparer : IComparer<T>; public static Span<T> AsSpan<T>(this T[] array, int start); public static bool Contains(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType); public static bool Equals(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType); public static int CompareTo(this ReadOnlySpan<char> span, ReadOnlySpan<char> other, StringComparison comparisonType); public static int IndexOf(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType); public static int ToLower(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo culture); public static int ToLowerInvariant(this ReadOnlySpan<char> source, Span<char> destination); public static int ToUpper(this ReadOnlySpan<char> source, Span<char> destination, CultureInfo culture); public static int ToUpperInvariant(this ReadOnlySpan<char> source, Span<char> destination); public static bool EndsWith(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType); public static bool StartsWith(this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType); public static ReadOnlySpan<char> AsSpan(this string text); public static ReadOnlySpan<char> AsSpan(this string text, int start); public static ReadOnlySpan<char> AsSpan(this string text, int start, int length); public static ReadOnlyMemory<char> AsMemory(this string text); public static ReadOnlyMemory<char> AsMemory(this string text, int start); public static ReadOnlyMemory<char> AsMemory(this string text, int start, int length); } }