System::MemoryExtensions

Provides extension methods for memory operations on spans and arrays.

Functions

FunctionDescription
ReadOnlySpan<char16_t> AsSpan(const String&, int32_t, int32_t)Creates a read-only span from a string.
Span<T> AsSpan(const ArrayPtr<T>&, int32_t, int32_t)Creates a span from an array.
int32_t BinarySearch(const ReadOnlySpan<T>&, const TComparable&)Performs binary search on a sorted span.
int32_t BinarySearch(const ReadOnlySpan<T>&, const T&, const SharedPtr<TComparer>&)Performs binary search on a sorted span using a custom comparer.
int32_t BinarySearch(const Span<T>&, const TComparable&)Performs binary search on a mutable sorted span.
int32_t BinarySearch(const Span<T>&, const T&, const SharedPtr<TComparer>&)Performs binary search on a mutable sorted span using a custom comparer.
int32_t CommonPrefixLength(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the length of the common prefix between two spans.
int32_t CommonPrefixLength(const Span<T>&, const ReadOnlySpan<T>&)Finds the length of the common prefix between a mutable span and a read-only span.
int32_t CommonPrefixLength(const Span<T>&, const Span<T>&)Finds the length of the common prefix between two mutable spans.
int32_t CommonPrefixLength(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&, const SharedPtr<TEqualityComparer>&)Finds the length of the common prefix between two spans using a custom equality comparer.
int32_t CommonPrefixLength(const Span<T>&, const ReadOnlySpan<T>&, const SharedPtr<TEqualityComparer>&)Finds the length of the common prefix between a mutable span and a read-only span using a custom equality comparer.
int32_t CommonPrefixLength(const Span<T>&, const Span<T>&, const SharedPtr<TEqualityComparer>&)Finds the length of the common prefix between two mutable spans using a custom equality comparer.
int32_t CompareTo(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Compares two character spans with specified string comparison rules.
bool Contains(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Checks if a character span contains another character span with specified comparison rules.
bool Contains(const ReadOnlySpan<T>&, const T&)Checks if a read-only span contains a specific value.
bool Contains(const Span<T>&, const T&)Checks if a mutable span contains a specific value.
bool ContainsAny(const ReadOnlySpan<T>&, const T&, const T&)Checks if a read-only span contains any of two values.
bool ContainsAny(const ReadOnlySpan<T>&, const T&, const T&, const T&)Checks if a read-only span contains any of three values.
bool ContainsAny(const Span<T>&, const T&, const T&)Checks if a mutable span contains any of two values.
bool ContainsAny(const Span<T>&, const T&, const T&, const T&)Checks if a mutable span contains any of three values.
bool ContainsAny(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Checks if a read-only span contains any value from another span.
bool ContainsAny(const Span<T>&, const ReadOnlySpan<T>&)Checks if a mutable span contains any value from a read-only span.
bool ContainsAnyExcept(const ReadOnlySpan<T>&, const T&, const T&, const T&)Checks if a read-only span contains any element except three specified values.
bool ContainsAnyExcept(const Span<T>&, const T&, const T&, const T&)Checks if a mutable span contains any element except three specified values.
bool ContainsAnyExcept(const ReadOnlySpan<T>&, const T&, const T&)Checks if a read-only span contains any element except two specified values.
bool ContainsAnyExcept(const Span<T>&, const T&, const T&)Checks if a mutable span contains any element except two specified values.
bool ContainsAnyExcept(const ReadOnlySpan<T>&, const T&)Checks if a read-only span contains any element except a specified value.
bool ContainsAnyExcept(const Span<T>&, const T&)Checks if a mutable span contains any element except a specified value.
bool ContainsAnyExcept(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Checks if a read-only span contains any element except those in another span.
bool ContainsAnyExcept(const Span<T>&, const ReadOnlySpan<T>&)Checks if a mutable span contains any element except those in a read-only span.
bool ContainsAnyExceptInRange(const ReadOnlySpan<T>&, const T&, const T&)Checks if a read-only span contains any element outside the specified range.
bool ContainsAnyExceptInRange(const Span<T>&, const T&, const T&)Checks if a mutable span contains any element outside the specified range.
bool ContainsAnyInRange(const ReadOnlySpan<T>&, const T&, const T&)Checks if a read-only span contains any element within the specified range.
bool ContainsAnyInRange(const Span<T>&, const T&, const T&)Checks if a mutable span contains any element within the specified range.
void CopyTo(const ArrayPtr<T>&, Span<T>&)Copies elements from an array to a span.
int32_t Count(const ReadOnlySpan<T>&, const T&)Counts occurrences of a value in a read-only span.
int32_t Count(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Counts occurrences of a span within another read-only span.
int32_t Count(const Span<T>&, const T&)Counts occurrences of a single value in a Span
int32_t Count(const Span<T>&, const ReadOnlySpan<T>&)Counts occurrences of a ReadOnlySpan in a Span
bool EndsWith(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Determines if a ReadOnlySpan<char16_t> ends with the specified value using StringComparison.
bool EndsWith(const ReadOnlySpan<T>&, const T&)Determines if a ReadOnlySpan ends with a single value.
bool EndsWith(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Determines if a ReadOnlySpan ends with another ReadOnlySpan
bool EndsWith(const Span<T>&, const ReadOnlySpan<T>&)Determines if a Span ends with a ReadOnlySpan
bool EndsWith(const ReadOnlySpan<T>&, const Span<T>&)Determines if a ReadOnlySpan ends with a Span
bool EndsWith(const Span<T>&, const Span<T>&)Determines if a Span ends with another Span
bool Equals(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Compares two ReadOnlySpan<char16_t> for equality using StringComparison.
int32_t IndexOf(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Finds the index of a ReadOnlySpan<char16_t> value in a ReadOnlySpan<char16_t> with StringComparison.
int32_t IndexOf(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the index of a ReadOnlySpan value in another ReadOnlySpan
int32_t IndexOf(const ReadOnlySpan<T>&, const T&)Finds the index of a single value in a ReadOnlySpan
int32_t IndexOf(const Span<T>&, const ReadOnlySpan<T>&)Finds the index of a ReadOnlySpan value in a Span
int32_t IndexOf(const Span<T>&, const T&)Finds the index of a single value in a Span
int32_t IndexOfAny(const ReadOnlySpan<T>&, const T&, const T&)Finds the index of the first occurrence of any of two specified values in a ReadOnlySpan
int32_t IndexOfAny(const ReadOnlySpan<T>&, const T&, const T&, const T&)Finds the index of the first occurrence of any of three specified values in a ReadOnlySpan
int32_t IndexOfAny(const Span<T>&, const T&, const T&)Finds the index of the first occurrence of any of two specified values in a Span
int32_t IndexOfAny(const Span<T>&, const T&, const T&, const T&)Finds the index of the first occurrence of any of three specified values in a Span
int32_t IndexOfAny(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the index of the first occurrence of any value from a span in another ReadOnlySpan
int32_t IndexOfAny(const Span<T>&, const ReadOnlySpan<T>&)Finds the index of the first occurrence of any value from a span in a Span
int32_t IndexOfAnyExcept(const ReadOnlySpan<T>&, const T&)Finds the index of the first element that is not equal to the specified value in a ReadOnlySpan
int32_t IndexOfAnyExcept(const ReadOnlySpan<T>&, const T&, const T&)Finds the index of the first element that is not equal to either of two specified values in a ReadOnlySpan
int32_t IndexOfAnyExcept(const ReadOnlySpan<T>&, const T&, const T&, const T&)Finds the index of the first element that is not equal to any of three specified values in a ReadOnlySpan
int32_t IndexOfAnyExcept(const Span<T>&, const T&)Finds the index of the first element that is not equal to the specified value in a Span
int32_t IndexOfAnyExcept(const Span<T>&, const T&, const T&)Finds the index of the first element that is not equal to either of two specified values in a Span
int32_t IndexOfAnyExcept(const Span<T>&, const T&, const T&, const T&)Finds the index of the first element that is not equal to any of three specified values in a Span
int32_t IndexOfAnyExcept(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the index of the first element that is not equal to any value in a span of values.
int32_t IndexOfAnyExcept(const Span<T>&, const ReadOnlySpan<T>&)Finds the index of the first element that is not equal to any value in a span of values in a Span
int32_t IndexOfAnyExceptInRange(const ReadOnlySpan<T>&, const T&, const T&)Finds the index of the first element that is outside the specified range in a ReadOnlySpan
int32_t IndexOfAnyExceptInRange(const Span<T>&, const T&, const T&)Finds the index of the first element that is outside the specified range in a Span
int32_t IndexOfAnyInRange(const ReadOnlySpan<T>&, const T&, const T&)Finds the index of the first element that is within the specified range in a ReadOnlySpan
int32_t IndexOfAnyInRange(const Span<T>&, const T&, const T&)Finds the index of the first element that is within the specified range in a Span
bool IsWhiteSpace(const ReadOnlySpan<char16_t>&)Checks if the entire span consists only of whitespace characters.
int32_t LastIndexOf(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Finds the last occurrence of a value within a span using specified string comparison.
int32_t LastIndexOf(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of a sequence within a span.
int32_t LastIndexOf(const ReadOnlySpan<T>&, const T&)Finds the last occurrence of a single value within a span.
int32_t LastIndexOf(const Span<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of a sequence within a mutable span.
int32_t LastIndexOf(const Span<T>&, const T&)Finds the last occurrence of a single value within a mutable span.
int32_t LastIndexOfAny(const ReadOnlySpan<T>&, const T&, const T&, const T&)Finds the last occurrence of any of three specified values within a span.
int32_t LastIndexOfAny(const Span<T>&, const T&, const T&, const T&)Finds the last occurrence of any of three specified values within a mutable span.
int32_t LastIndexOfAny(const ReadOnlySpan<T>&, const T&, const T&)Finds the last occurrence of any of two specified values within a span.
int32_t LastIndexOfAny(const Span<T>&, const T&, const T&)Finds the last occurrence of any of two specified values within a mutable span.
int32_t LastIndexOfAny(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of any value from a sequence within a span.
int32_t LastIndexOfAny(const Span<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of any value from a sequence within a mutable span.
int32_t LastIndexOfAny(const Span<T>&, const Span<T>&)Finds the last occurrence of any value from a mutable sequence within a mutable span.
int32_t LastIndexOfAnyExcept(const ReadOnlySpan<T>&, const T&, const T&, const T&)Finds the last occurrence of any element except three specified values within a span.
int32_t LastIndexOfAnyExcept(const Span<T>&, const T&, const T&, const T&)Finds the last occurrence of any element except three specified values within a mutable span.
int32_t LastIndexOfAnyExcept(const ReadOnlySpan<T>&, const T&, const T&)Finds the last occurrence of any element except two specified values within a span.
int32_t LastIndexOfAnyExcept(const Span<T>&, const T&, const T&)Finds the last occurrence of any element except two specified values within a mutable span.
int32_t LastIndexOfAnyExcept(const ReadOnlySpan<T>&, const T&)Finds the last occurrence of any element except a specified value within a span.
int32_t LastIndexOfAnyExcept(const Span<T>&, const T&)Finds the last occurrence of any element except a specified value within a mutable span.
int32_t LastIndexOfAnyExcept(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of any element except values from a sequence within a span.
int32_t LastIndexOfAnyExcept(const Span<T>&, const ReadOnlySpan<T>&)Finds the last occurrence of any element except values from a sequence within a mutable span.
int32_t LastIndexOfAnyExcept(const Span<T>&, const Span<T>&)Finds the last occurrence of any element except values from a mutable sequence within a mutable span.
int32_t LastIndexOfAnyExceptInRange(const ReadOnlySpan<T>&, const T&, const T&)Finds the last occurrence of any element outside the specified range within a span.
int32_t LastIndexOfAnyExceptInRange(const Span<T>&, const T&, const T&)Finds the last occurrence of any element outside the specified range within a mutable span.
int32_t LastIndexOfAnyInRange(const ReadOnlySpan<T>&, const T&, const T&)Finds the last occurrence of any element within the specified range within a span.
int32_t LastIndexOfAnyInRange(const Span<T>&, const T&, const T&)Finds the last occurrence of any element within the specified range within a mutable span.
bool Overlaps(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Determines if two ReadOnlySpans overlap in memory without calculating offset.
bool Overlaps(const Span<T>&, const ReadOnlySpan<T>&)Determines if a Span and ReadOnlySpan overlap in memory without calculating offset.
bool Overlaps(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&, int32_t&)Determines if two ReadOnlySpans overlap in memory and calculates the offset.
bool Overlaps(const Span<T>&, const ReadOnlySpan<T>&, int32_t&)Determines if a Span and ReadOnlySpan overlap in memory and calculates the offset.
void Replace(Span<T>&, const T&, const T&)Replaces all occurrences of a value with a new value in a Span.
void Replace(const ReadOnlySpan<T>&, Span<T>&, const T&, const T&)Copies elements from source to destination, replacing specified values during copy.
void Reverse(Span<T>&)Reverses the order of elements in a Span in-place.
int32_t SequenceCompareTo(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Compares two ReadOnlySpans lexicographically.
int32_t SequenceCompareTo(const Span<T>&, const ReadOnlySpan<T>&)Compares a Span and ReadOnlySpan lexicographically.
int32_t SequenceCompareTo(const ReadOnlySpan<T>&, const Span<T>&)Compares a ReadOnlySpan and Span lexicographically.
bool SequenceEqual(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Determines if two ReadOnlySpans contain identical elements in the same order.
bool SequenceEqual(const Span<T>&, const ReadOnlySpan<T>&)Determines if a Span and ReadOnlySpan contain identical elements in the same order.
bool SequenceEqual(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&, SharedPtr<TComparer>&)Determines if two ReadOnlySpans contain equal elements using a custom comparer.
bool SequenceEqual(const Span<T>&, const ReadOnlySpan<T>&, SharedPtr<TComparer>&)Determines if a Span and ReadOnlySpan contain equal elements using a custom comparer.
void Sort(const Span<T>&, const SharedPtr<TComparer>&)Sorts a Span using a custom comparer.
void Sort(Span<T>&)Sorts a Span using default comparison.
void Sort(Span<TKey>&, Span<TValue>&, const SharedPtr<TComparer>&)Sorts key-value pairs using a custom comparer (keys and values sorted together)
void Sort(Span<TKey>&, Span<TValue>&, System::Comparison<TKey>)Sorts key-value pairs using a comparison delegate.
void Sort(Span<TKey>&, Span<TValue>&)Sorts key-value pairs using default comparison.
bool StartsWith(const ReadOnlySpan<T>&, const T&)Checks if the span starts with the specified value.
bool StartsWith(const ReadOnlySpan<String>&, const char16_t *)Checks if a string span starts with the specified character array.
bool StartsWith(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Checks if the span starts with the specified value span.
bool StartsWith(const Span<T>&, const ReadOnlySpan<T>&)Checks if the mutable span starts with the specified read-only value span.
bool StartsWith(const ReadOnlySpan<T>&, const Span<T>&)Checks if the read-only span starts with the specified mutable value span.
bool StartsWith(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&, StringComparison)Checks if the character span starts with the specified value span using string comparison.
int32_t ToLower(const ReadOnlySpan<char16_t>&, Span<char16_t>&, const SharedPtr<Globalization::CultureInfo>&)Converts characters to lowercase using specified culture.
int32_t ToLowerInvariant(const ReadOnlySpan<char16_t>&, Span<char16_t>&)Converts characters to lowercase using invariant culture.
int32_t ToUpper(const ReadOnlySpan<char16_t>&, Span<char16_t>&, const SharedPtr<Globalization::CultureInfo>&)Converts characters to uppercase using specified culture.
int32_t ToUpperInvariant(const ReadOnlySpan<char16_t>&, Span<char16_t>&)Converts characters to uppercase using invariant culture.
ReadOnlySpan<T> Trim(const ReadOnlySpan<T>&, T)Trims specified element from both ends of a typed span.
Span<T> Trim(Span<T>&, T)Trims specified element from both ends of a mutable typed span.
ReadOnlySpan<T> Trim(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Trims specified elements from both ends of a typed span.
Span<T> Trim(Span<T>&, const ReadOnlySpan<T>&)Trims specified elements from both ends of a mutable typed span.
ReadOnlySpan<char16_t> Trim(const ReadOnlySpan<char16_t>&)Trims whitespace characters from both ends of a character span.
Span<char16_t> Trim(Span<char16_t>&)Trims whitespace characters from both ends of a mutable character span.
ReadOnlySpan<T> TrimEnd(const ReadOnlySpan<T>&, const T&)Trims specified element from the end of a typed span.
Span<T> TrimEnd(Span<T>&, const T&)Trims specified element from the end of a mutable typed span.
ReadOnlySpan<T> TrimEnd(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Trims specified elements from the end of a typed span.
Span<T> TrimEnd(Span<T>&, const ReadOnlySpan<T>&)Trims specified elements from the end of a mutable typed span.
ReadOnlySpan<char16_t> TrimEnd(const ReadOnlySpan<char16_t>&)Trims whitespace characters from the end of a character span.
Span<char16_t> TrimEnd(Span<char16_t>&)Trims whitespace characters from the end of a mutable character span.
ReadOnlySpan<char16_t> TrimEnd(const ReadOnlySpan<char16_t>&, char16_t)Trims specified character from the end of a character span.
Span<char16_t> TrimEnd(Span<char16_t>&, char16_t)Trims specified character from the end of a mutable character span.
ReadOnlySpan<char16_t> TrimEnd(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&)Trims specified characters from the end of a character span.
Span<char16_t> TrimEnd(Span<char16_t>&, const ReadOnlySpan<char16_t>&)Trims specified characters from the end of a mutable character span.
ReadOnlySpan<T> TrimStart(const ReadOnlySpan<T>&, const T&)Trims specified element from the start of a typed span.
Span<T> TrimStart(Span<T>&, const T&)Trims specified element from the start of a mutable typed span.
ReadOnlySpan<T> TrimStart(const ReadOnlySpan<T>&, const ReadOnlySpan<T>&)Trims specified elements from the start of a typed span.
Span<T> TrimStart(Span<T>&, const ReadOnlySpan<T>&)Trims specified elements from the start of a mutable typed span.
ReadOnlySpan<char16_t> TrimStart(const ReadOnlySpan<char16_t>&)Trims whitespace characters from the start of a character span.
Span<char16_t> TrimStart(Span<char16_t>&)Trims whitespace characters from the start of a mutable character span.
ReadOnlySpan<char16_t> TrimStart(const ReadOnlySpan<char16_t>&, char16_t)Trims specified character from the start of a character span.
Span<char16_t> TrimStart(Span<char16_t>&, char16_t)Trims specified character from the start of a mutable character span.
ReadOnlySpan<char16_t> TrimStart(const ReadOnlySpan<char16_t>&, const ReadOnlySpan<char16_t>&)Trims specified characters from the start of a character span.
Span<char16_t> TrimStart(Span<char16_t>&, const ReadOnlySpan<char16_t>&)Trims specified characters from the start of a mutable character span.