CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::MemoryExtensions Namespace Reference

Provides extension methods for memory operations on spans and arrays. More...

Namespaces

namespace  Details
 

Functions

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

Detailed Description

Provides extension methods for memory operations on spans and arrays.

Function Documentation

◆ AsSpan() [1/2]

template<typename T >
Span< T > System::MemoryExtensions::AsSpan ( const ArrayPtr< T > &  array,
int32_t  start = 0,
int32_t  length = -1 
)

Creates a span from an array.

Template Parameters
TThe type of elements in the array.
Parameters
arrayThe source array.
startThe starting index in the array.
lengthThe length of the span.
Returns
Span<T> spanning the specified portion of the array.

◆ AsSpan() [2/2]

ReadOnlySpan< char16_t > System::MemoryExtensions::AsSpan ( const String text,
int32_t  start = 0,
int32_t  length = -1 
)

Creates a read-only span from a string.

Parameters
textThe source string.
startThe starting index in the string.
lengthThe length of the span.
Returns
ReadOnlySpan<char16_t> spanning the specified portion of the string.

◆ BinarySearch() [1/4]

template<typename T , typename TComparer >
int32_t System::MemoryExtensions::BinarySearch ( const ReadOnlySpan< T > &  span,
const T &  value,
const SharedPtr< TComparer > &  comparerPtr 
)

Performs binary search on a sorted span using a custom comparer.

Template Parameters
TThe type of elements in the span
TComparerThe type of the comparer
Parameters
spanThe sorted span to search
valueThe value to search for
comparerPtrThe comparer to use for comparisons
Returns
Index of the found element, or bitwise complement of the insertion point if not found

◆ BinarySearch() [2/4]

template<typename T , typename TComparable >
int32_t System::MemoryExtensions::BinarySearch ( const ReadOnlySpan< T > &  span,
const TComparable &  comparable 
)

Performs binary search on a sorted span.

Template Parameters
TThe type of elements in the span
TComparableThe type of the comparable value
Parameters
spanThe sorted span to search
comparableThe value to search for
Returns
Index of the found element, or bitwise complement of the insertion point if not found

◆ BinarySearch() [3/4]

template<typename T , typename TComparer >
int32_t System::MemoryExtensions::BinarySearch ( const Span< T > &  span,
const T &  value,
const SharedPtr< TComparer > &  comparer 
)

Performs binary search on a mutable sorted span using a custom comparer.

Template Parameters
TThe type of elements in the span
TComparerThe type of the comparer
Parameters
spanThe sorted span to search
valueThe value to search for
comparerThe comparer to use for comparisons
Returns
Index of the found element, or bitwise complement of the insertion point if not found

◆ BinarySearch() [4/4]

template<typename T , typename TComparable >
int32_t System::MemoryExtensions::BinarySearch ( const Span< T > &  span,
const TComparable &  comparable 
)

Performs binary search on a mutable sorted span.

Template Parameters
TThe type of elements in the span
TComparableThe type of the comparable value
Parameters
spanThe sorted span to search
comparableThe value to search for
Returns
Index of the found element, or bitwise complement of the insertion point if not found

◆ CommonPrefixLength() [1/6]

template<typename T >
int32_t System::MemoryExtensions::CommonPrefixLength ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other 
)

Finds the length of the common prefix between two spans.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe first span
otherThe second span
Returns
The number of matching elements at the beginning of both spans

◆ CommonPrefixLength() [2/6]

template<typename T , typename TEqualityComparer >
int32_t System::MemoryExtensions::CommonPrefixLength ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other,
const SharedPtr< TEqualityComparer > &  comparer 
)

Finds the length of the common prefix between two spans using a custom equality comparer.

Template Parameters
TThe type of elements in the spans
TEqualityComparerThe type of the equality comparer
Parameters
spanThe first span
otherThe second span
comparerThe equality comparer to use for element comparison
Returns
The number of matching elements at the beginning of both spans

◆ CommonPrefixLength() [3/6]

template<typename T >
int32_t System::MemoryExtensions::CommonPrefixLength ( const Span< T > &  span,
const ReadOnlySpan< T > &  other 
)

Finds the length of the common prefix between a mutable span and a read-only span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe mutable span
otherThe read-only span
Returns
The number of matching elements at the beginning of both spans

◆ CommonPrefixLength() [4/6]

template<typename T , typename TEqualityComparer >
int32_t System::MemoryExtensions::CommonPrefixLength ( const Span< T > &  span,
const ReadOnlySpan< T > &  other,
const SharedPtr< TEqualityComparer > &  comparer 
)

Finds the length of the common prefix between a mutable span and a read-only span using a custom equality comparer.

Template Parameters
TThe type of elements in the spans
TEqualityComparerThe type of the equality comparer
Parameters
spanThe mutable span
otherThe read-only span
comparerThe equality comparer to use for element comparison
Returns
The number of matching elements at the beginning of both spans

◆ CommonPrefixLength() [5/6]

template<typename T >
int32_t System::MemoryExtensions::CommonPrefixLength ( const Span< T > &  span,
const Span< T > &  other 
)

Finds the length of the common prefix between two mutable spans.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe first mutable span
otherThe second mutable span
Returns
The number of matching elements at the beginning of both spans

◆ CommonPrefixLength() [6/6]

template<typename T , typename TEqualityComparer >
int32_t System::MemoryExtensions::CommonPrefixLength ( const Span< T > &  span,
const Span< T > &  other,
const SharedPtr< TEqualityComparer > &  comparer 
)

Finds the length of the common prefix between two mutable spans using a custom equality comparer.

Template Parameters
TThe type of elements in the spans
TEqualityComparerThe type of the equality comparer
Parameters
spanThe first mutable span
otherThe second mutable span
comparerThe equality comparer to use for element comparison
Returns
The number of matching elements at the beginning of both spans

◆ CompareTo()

int32_t System::MemoryExtensions::CompareTo ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  other,
StringComparison  comparisonType 
)

Compares two character spans with specified string comparison rules.

Parameters
spanThe first character span
otherThe second character span
comparisonTypeThe type of string comparison to perform
Returns
Negative value if span < other, zero if equal, positive if span > other

◆ Contains() [1/3]

bool System::MemoryExtensions::Contains ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  value,
StringComparison  comparisonType 
)

Checks if a character span contains another character span with specified comparison rules.

Parameters
spanThe span to search in
valueThe span to search for
comparisonTypeThe type of string comparison to perform
Returns
true if value is found in span, false otherwise

◆ Contains() [2/3]

template<typename T >
bool System::MemoryExtensions::Contains ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Checks if a read-only span contains a specific value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to search for
Returns
true if value is found in span, false otherwise

◆ Contains() [3/3]

template<typename T >
bool System::MemoryExtensions::Contains ( const Span< T > &  span,
const T &  value 
)

Checks if a mutable span contains a specific value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
valueThe value to search for
Returns
true if value is found in span, false otherwise

◆ ContainsAny() [1/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Checks if a read-only span contains any value from another span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span of values to search for
Returns
true if any value from values is found in span, false otherwise

◆ ContainsAny() [2/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Checks if a read-only span contains any of two values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
Returns
true if any of the values is found in span, false otherwise

◆ ContainsAny() [3/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Checks if a read-only span contains any of three values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
true if any of the values is found in span, false otherwise

◆ ContainsAny() [4/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Checks if a mutable span contains any value from a read-only span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe mutable span to search in
valuesThe read-only span of values to search for
Returns
true if any value from values is found in span, false otherwise

◆ ContainsAny() [5/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Checks if a mutable span contains any of two values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
value0The first value to search for
value1The second value to search for
Returns
true if any of the values is found in span, false otherwise

◆ ContainsAny() [6/6]

template<typename T >
bool System::MemoryExtensions::ContainsAny ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Checks if a mutable span contains any of three values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
true if any of the values is found in span, false otherwise

◆ ContainsAnyExcept() [1/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Checks if a read-only span contains any element except those in another span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span of values to exclude
Returns
true if any element not in values is found, false otherwise

◆ ContainsAnyExcept() [2/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Checks if a read-only span contains any element except a specified value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to exclude
Returns
true if any element different from the specified value is found, false otherwise

◆ ContainsAnyExcept() [3/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Checks if a read-only span contains any element except two specified values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude
value1The second value to exclude
Returns
true if any element different from the specified values is found, false otherwise

◆ ContainsAnyExcept() [4/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Checks if a read-only span contains any element except three specified values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude
value1The second value to exclude
value2The third value to exclude
Returns
true if any element different from the specified values is found, false otherwise

◆ ContainsAnyExcept() [5/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Checks if a mutable span contains any element except those in a read-only span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe mutable span to search in
valuesThe read-only span of values to exclude
Returns
true if any element not in values is found, false otherwise

◆ ContainsAnyExcept() [6/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const Span< T > &  span,
const T &  value 
)

Checks if a mutable span contains any element except a specified value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
valueThe value to exclude
Returns
true if any element different from the specified value is found, false otherwise

◆ ContainsAnyExcept() [7/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Checks if a mutable span contains any element except two specified values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
value0The first value to exclude
value1The second value to exclude
Returns
true if any element different from the specified values is found, false otherwise

◆ ContainsAnyExcept() [8/8]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Checks if a mutable span contains any element except three specified values.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to search in
value0The first value to exclude
value1The second value to exclude
value2The third value to exclude
Returns
true if any element different from the specified values is found, false otherwise

◆ ContainsAnyExceptInRange() [1/2]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExceptInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Checks if a read-only span contains any element outside the specified range.

Template Parameters
TThe type of elements in the span (must be comparable)
Parameters
spanThe span to search in
lowInclusiveThe lower bound (inclusive)
highInclusiveThe upper bound (inclusive)
Returns
true if any element outside the range is found, false otherwise

◆ ContainsAnyExceptInRange() [2/2]

template<typename T >
bool System::MemoryExtensions::ContainsAnyExceptInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Checks if a mutable span contains any element outside the specified range.

Template Parameters
TThe type of elements in the span (must be comparable)
Parameters
spanThe mutable span to search in
lowInclusiveThe lower bound (inclusive)
highInclusiveThe upper bound (inclusive)
Returns
true if any element outside the range is found, false otherwise

◆ ContainsAnyInRange() [1/2]

template<typename T >
bool System::MemoryExtensions::ContainsAnyInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Checks if a read-only span contains any element within the specified range.

Template Parameters
TThe type of elements in the span (must be comparable)
Parameters
spanThe span to search in
lowInclusiveThe lower bound (inclusive)
highInclusiveThe upper bound (inclusive)
Returns
true if any element within the range is found, false otherwise

◆ ContainsAnyInRange() [2/2]

template<typename T >
bool System::MemoryExtensions::ContainsAnyInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Checks if a mutable span contains any element within the specified range.

Template Parameters
TThe type of elements in the span (must be comparable)
Parameters
spanThe mutable span to search in
lowInclusiveThe lower bound (inclusive)
highInclusiveThe upper bound (inclusive)
Returns
true if any element within the range is found, false otherwise

◆ CopyTo()

template<typename T >
void System::MemoryExtensions::CopyTo ( const ArrayPtr< T > &  source,
Span< T > &  destination 
)

Copies elements from an array to a span.

Template Parameters
TThe type of elements in the array and span
Parameters
sourceThe source array
destinationThe destination span

◆ Count() [1/4]

template<typename T >
int32_t System::MemoryExtensions::Count ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  value 
)

Counts occurrences of a span within another read-only span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valueThe span to count occurrences of
Returns
The number of times value appears in span

◆ Count() [2/4]

template<typename T >
int32_t System::MemoryExtensions::Count ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Counts occurrences of a value in a read-only span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to count
Returns
The number of times value appears in span

◆ Count() [3/4]

template<typename T >
int32_t System::MemoryExtensions::Count ( const Span< T > &  span,
const ReadOnlySpan< T > &  value 
)

Counts occurrences of a ReadOnlySpan<T> in a Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valueThe span containing values to count occurrences of
Returns
The number of occurrences of the value span in the target span

◆ Count() [4/4]

template<typename T >
int32_t System::MemoryExtensions::Count ( const Span< T > &  span,
const T &  value 
)

Counts occurrences of a single value in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to count occurrences of
Returns
The number of occurrences of the value in the span

◆ EndsWith() [1/6]

bool System::MemoryExtensions::EndsWith ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  value,
StringComparison  comparisonType 
)

Determines if a ReadOnlySpan<char16_t> ends with the specified value using StringComparison.

Parameters
spanThe span to check
valueThe value to check for at the end of the span
comparisonTypeThe string comparison type to use
Returns
true if the span ends with the value, false otherwise

◆ EndsWith() [2/6]

template<typename T >
bool System::MemoryExtensions::EndsWith ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  value 
)

Determines if a ReadOnlySpan<T> ends with another ReadOnlySpan<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to check
valueThe span to check for at the end of the target span
Returns
true if the span ends with the value span, false otherwise

◆ EndsWith() [3/6]

template<typename T >
bool System::MemoryExtensions::EndsWith ( const ReadOnlySpan< T > &  span,
const Span< T > &  value 
)

Determines if a ReadOnlySpan<T> ends with a Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to check
valueThe span to check for at the end of the target span
Returns
true if the span ends with the value span, false otherwise

◆ EndsWith() [4/6]

template<typename T >
bool System::MemoryExtensions::EndsWith ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Determines if a ReadOnlySpan<T> ends with a single value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to check
valueThe value to check for at the end of the span
Returns
true if the span ends with the value, false otherwise

◆ EndsWith() [5/6]

template<typename T >
bool System::MemoryExtensions::EndsWith ( const Span< T > &  span,
const ReadOnlySpan< T > &  value 
)

Determines if a Span<T> ends with a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to check
valueThe span to check for at the end of the target span
Returns
true if the span ends with the value span, false otherwise

◆ EndsWith() [6/6]

template<typename T >
bool System::MemoryExtensions::EndsWith ( const Span< T > &  span,
const Span< T > &  value 
)

Determines if a Span<T> ends with another Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to check
valueThe span to check for at the end of the target span
Returns
true if the span ends with the value span, false otherwise

◆ Equals()

bool System::MemoryExtensions::Equals ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  other,
StringComparison  comparisonType 
)

Compares two ReadOnlySpan<char16_t> for equality using StringComparison.

Parameters
spanThe first span to compare
otherThe second span to compare
comparisonTypeThe string comparison type to use
Returns
true if the spans are equal, false otherwise

◆ IndexOf() [1/5]

int32_t System::MemoryExtensions::IndexOf ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  value,
StringComparison  comparisonType 
)

Finds the index of a ReadOnlySpan<char16_t> value in a ReadOnlySpan<char16_t> with StringComparison.

Parameters
spanThe span to search in
valueThe value to search for
comparisonTypeThe string comparison type to use
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOf() [2/5]

template<typename T >
int32_t System::MemoryExtensions::IndexOf ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  value 
)

Finds the index of a ReadOnlySpan<T> value in another ReadOnlySpan<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valueThe span to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOf() [3/5]

template<typename T >
int32_t System::MemoryExtensions::IndexOf ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Finds the index of a single value in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOf() [4/5]

template<typename T >
int32_t System::MemoryExtensions::IndexOf ( const Span< T > &  span,
const ReadOnlySpan< T > &  value 
)

Finds the index of a ReadOnlySpan<T> value in a Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valueThe span to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOf() [5/5]

template<typename T >
int32_t System::MemoryExtensions::IndexOf ( const Span< T > &  span,
const T &  value 
)

Finds the index of a single value in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [1/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the index of the first occurrence of any value from a span in another ReadOnlySpan<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span containing values to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [2/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the index of the first occurrence of any of two specified values in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [3/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the index of the first occurrence of any of three specified values in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [4/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the index of the first occurrence of any value from a span in a Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span containing values to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [5/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the index of the first occurrence of any of two specified values in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAny() [6/6]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAny ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the index of the first occurrence of any of three specified values in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
The zero-based index of the first occurrence, or -1 if not found

◆ IndexOfAnyExcept() [1/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the index of the first element that is not equal to any value in a span of values.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span containing values to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [2/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Finds the index of the first element that is not equal to the specified value in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [3/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the index of the first element that is not equal to either of two specified values in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude from the search
value1The second value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [4/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the index of the first element that is not equal to any of three specified values in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude from the search
value1The second value to exclude from the search
value2The third value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [5/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the index of the first element that is not equal to any value in a span of values in a Span<T>

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to search in
valuesThe span containing values to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [6/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const Span< T > &  span,
const T &  value 
)

Finds the index of the first element that is not equal to the specified value in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
valueThe value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [7/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the index of the first element that is not equal to either of two specified values in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude from the search
value1The second value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExcept() [8/8]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the index of the first element that is not equal to any of three specified values in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
value0The first value to exclude from the search
value1The second value to exclude from the search
value2The third value to exclude from the search
Returns
The zero-based index of the first non-matching element, or -1 if not found

◆ IndexOfAnyExceptInRange() [1/2]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExceptInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the index of the first element that is outside the specified range in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the first element outside the range, or -1 if not found

◆ IndexOfAnyExceptInRange() [2/2]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyExceptInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the index of the first element that is outside the specified range in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the first element outside the range, or -1 if not found

◆ IndexOfAnyInRange() [1/2]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the index of the first element that is within the specified range in a ReadOnlySpan<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the first element within the range, or -1 if not found

◆ IndexOfAnyInRange() [2/2]

template<typename T >
int32_t System::MemoryExtensions::IndexOfAnyInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the index of the first element that is within the specified range in a Span<T>

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search in
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the first element within the range, or -1 if not found

◆ IsWhiteSpace()

bool System::MemoryExtensions::IsWhiteSpace ( const ReadOnlySpan< char16_t > &  span)

Checks if the entire span consists only of whitespace characters.

Parameters
spanThe span to check for whitespace
Returns
true if all characters in the span are whitespace, false otherwise

◆ LastIndexOf() [1/5]

int32_t System::MemoryExtensions::LastIndexOf ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  value,
StringComparison  comparisonType 
)

Finds the last occurrence of a value within a span using specified string comparison.

Parameters
spanThe span to search within
valueThe value to search for
comparisonTypeThe type of string comparison to perform
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOf() [2/5]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOf ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  value 
)

Finds the last occurrence of a sequence within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe sequence to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOf() [3/5]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOf ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Finds the last occurrence of a single value within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOf() [4/5]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOf ( const Span< T > &  span,
const ReadOnlySpan< T > &  value 
)

Finds the last occurrence of a sequence within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe sequence to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOf() [5/5]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOf ( const Span< T > &  span,
const T &  value 
)

Finds the last occurrence of a single value within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [1/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the last occurrence of any value from a sequence within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [2/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the last occurrence of any of two specified values within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to search for
value1The second value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [3/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the last occurrence of any of three specified values within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [4/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the last occurrence of any value from a sequence within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [5/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const Span< T > &  span,
const Span< T > &  values 
)

Finds the last occurrence of any value from a mutable sequence within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [6/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the last occurrence of any of two specified values within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to search for
value1The second value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAny() [7/7]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAny ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the last occurrence of any of three specified values within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to search for
value1The second value to search for
value2The third value to search for
Returns
The zero-based index of the last occurrence, or -1 if not found

◆ LastIndexOfAnyExcept() [1/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the last occurrence of any element except values from a sequence within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [2/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Finds the last occurrence of any element except a specified value within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [3/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the last occurrence of any element except two specified values within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to exclude
value1The second value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [4/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const ReadOnlySpan< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the last occurrence of any element except three specified values within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to exclude
value1The second value to exclude
value2The third value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [5/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const Span< T > &  span,
const ReadOnlySpan< T > &  values 
)

Finds the last occurrence of any element except values from a sequence within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [6/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const Span< T > &  span,
const Span< T > &  values 
)

Finds the last occurrence of any element except values from a mutable sequence within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valuesThe sequence of values to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [7/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const Span< T > &  span,
const T &  value 
)

Finds the last occurrence of any element except a specified value within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
valueThe value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [8/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1 
)

Finds the last occurrence of any element except two specified values within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to exclude
value1The second value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExcept() [9/9]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExcept ( const Span< T > &  span,
const T &  value0,
const T &  value1,
const T &  value2 
)

Finds the last occurrence of any element except three specified values within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
value0The first value to exclude
value1The second value to exclude
value2The third value to exclude
Returns
The zero-based index of the last non-excluded element, or -1 if not found

◆ LastIndexOfAnyExceptInRange() [1/2]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExceptInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the last occurrence of any element outside the specified range within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the last element outside the range, or -1 if not found

◆ LastIndexOfAnyExceptInRange() [2/2]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyExceptInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the last occurrence of any element outside the specified range within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the last element outside the range, or -1 if not found

◆ LastIndexOfAnyInRange() [1/2]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyInRange ( const ReadOnlySpan< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the last occurrence of any element within the specified range within a span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the last element within the range, or -1 if not found

◆ LastIndexOfAnyInRange() [2/2]

template<typename T >
int32_t System::MemoryExtensions::LastIndexOfAnyInRange ( const Span< T > &  span,
const T &  lowInclusive,
const T &  highInclusive 
)

Finds the last occurrence of any element within the specified range within a mutable span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to search within
lowInclusiveThe lower bound of the range (inclusive)
highInclusiveThe upper bound of the range (inclusive)
Returns
The zero-based index of the last element within the range, or -1 if not found

◆ Overlaps() [1/4]

template<typename T >
bool System::MemoryExtensions::Overlaps ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other 
)

Determines if two ReadOnlySpans overlap in memory without calculating offset.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe first span to check for overlap
otherThe second span to check for overlap
Returns
true if the spans share any common memory locations, false otherwise

◆ Overlaps() [2/4]

template<typename T >
bool System::MemoryExtensions::Overlaps ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other,
int32_t &  elementOffset 
)

Determines if two ReadOnlySpans overlap in memory and calculates the offset.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe first span to check for overlap
otherThe second span to check for overlap
elementOffsetOutput parameter that receives the offset between spans if they overlap
Returns
true if the spans share any common memory locations, false otherwise

◆ Overlaps() [3/4]

template<typename T >
bool System::MemoryExtensions::Overlaps ( const Span< T > &  span,
const ReadOnlySpan< T > &  other 
)

Determines if a Span and ReadOnlySpan overlap in memory without calculating offset.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe Span to check for overlap
otherThe ReadOnlySpan to check for overlap
Returns
true if the spans share any common memory locations, false otherwise

◆ Overlaps() [4/4]

template<typename T >
bool System::MemoryExtensions::Overlaps ( const Span< T > &  span,
const ReadOnlySpan< T > &  other,
int32_t &  elementOffset 
)

Determines if a Span and ReadOnlySpan overlap in memory and calculates the offset.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe Span to check for overlap
otherThe ReadOnlySpan to check for overlap
elementOffsetOutput parameter that receives the offset between spans if they overlap
Returns
true if the spans share any common memory locations, false otherwise

◆ Replace() [1/2]

template<typename T >
void System::MemoryExtensions::Replace ( const ReadOnlySpan< T > &  source,
Span< T > &  destination,
const T &  oldValue,
const T &  newValue 
)

Copies elements from source to destination, replacing specified values during copy.

Template Parameters
TThe type of elements in the spans
Parameters
sourceThe source ReadOnlySpan to copy from
destinationThe destination Span to copy to
oldValueThe value to search for and replace during copying
newValueThe new value to replace oldValue with
Exceptions
ArgumentExceptionif destination is smaller than source

◆ Replace() [2/2]

template<typename T >
void System::MemoryExtensions::Replace ( Span< T > &  span,
const T &  oldValue,
const T &  newValue 
)

Replaces all occurrences of a value with a new value in a Span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to modify in-place
oldValueThe value to search for and replace
newValueThe new value to replace oldValue with

◆ Reverse()

template<typename T >
void System::MemoryExtensions::Reverse ( Span< T > &  span)

Reverses the order of elements in a Span in-place.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to reverse

◆ SequenceCompareTo() [1/3]

template<typename T >
int32_t System::MemoryExtensions::SequenceCompareTo ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other 
)

Compares two ReadOnlySpans lexicographically.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe first span to compare
otherThe second span to compare
Returns
-1 if span < other, 0 if span == other, 1 if span > other

◆ SequenceCompareTo() [2/3]

template<typename T >
int32_t System::MemoryExtensions::SequenceCompareTo ( const ReadOnlySpan< T > &  span,
const Span< T > &  other 
)

Compares a ReadOnlySpan and Span lexicographically.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe ReadOnlySpan to compare
otherThe Span to compare
Returns
-1 if span < other, 0 if span == other, 1 if span > other

◆ SequenceCompareTo() [3/3]

template<typename T >
int32_t System::MemoryExtensions::SequenceCompareTo ( const Span< T > &  span,
const ReadOnlySpan< T > &  other 
)

Compares a Span and ReadOnlySpan lexicographically.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe Span to compare
otherThe ReadOnlySpan to compare
Returns
-1 if span < other, 0 if span == other, 1 if span > other

◆ SequenceEqual() [1/4]

template<typename T >
bool System::MemoryExtensions::SequenceEqual ( const ReadOnlySpan< T > &  first,
const ReadOnlySpan< T > &  second 
)

Determines if two ReadOnlySpans contain identical elements in the same order.

Template Parameters
TThe type of elements in the spans
Parameters
firstThe first span to compare
secondThe second span to compare
Returns
true if spans have same length and all elements are equal, false otherwise

◆ SequenceEqual() [2/4]

template<typename T , typename TComparer >
bool System::MemoryExtensions::SequenceEqual ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  other,
SharedPtr< TComparer > &  comparer 
)

Determines if two ReadOnlySpans contain equal elements using a custom comparer.

Template Parameters
TThe type of elements in the spans
TComparerThe type of the comparer object
Parameters
spanThe first span to compare
otherThe second span to compare
comparerSmart pointer to comparer object for element comparison
Returns
true if spans have same length and comparer considers all elements equal, false otherwise

◆ SequenceEqual() [3/4]

template<typename T >
bool System::MemoryExtensions::SequenceEqual ( const Span< T > &  span,
const ReadOnlySpan< T > &  other 
)

Determines if a Span and ReadOnlySpan contain identical elements in the same order.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe Span to compare
otherThe ReadOnlySpan to compare
Returns
true if spans have same length and all elements are equal, false otherwise

◆ SequenceEqual() [4/4]

template<typename T , typename TComparer >
bool System::MemoryExtensions::SequenceEqual ( const Span< T > &  span,
const ReadOnlySpan< T > &  other,
SharedPtr< TComparer > &  comparer 
)

Determines if a Span and ReadOnlySpan contain equal elements using a custom comparer.

Template Parameters
TThe type of elements in the spans
TComparerThe type of the comparer object
Parameters
spanThe Span to compare
otherThe ReadOnlySpan to compare
comparerSmart pointer to comparer object for element comparison
Returns
true if spans have same length and comparer considers all elements equal, false otherwise

◆ Sort() [1/5]

template<typename T , typename TComparer >
void System::MemoryExtensions::Sort ( const Span< T > &  span,
const SharedPtr< TComparer > &  comparer 
)

Sorts a Span using a custom comparer.

Template Parameters
TThe type of elements in the span
TComparerThe type of the comparer object
Parameters
spanThe span to sort
comparerSmart pointer to comparer object for element comparison

◆ Sort() [2/5]

template<typename T >
void System::MemoryExtensions::Sort ( Span< T > &  span)

Sorts a Span using default comparison.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to sort

◆ Sort() [3/5]

template<typename TKey , typename TValue >
void System::MemoryExtensions::Sort ( Span< TKey > &  keys,
Span< TValue > &  values 
)

Sorts key-value pairs using default comparison.

Template Parameters
TKeyThe type of keys
TValueThe type of values
Parameters
keysThe span of keys to sort
valuesThe span of values to sort
Exceptions
ArgumentExceptionif keys and values have different lengths

◆ Sort() [4/5]

template<typename TKey , typename TValue , typename TComparer >
void System::MemoryExtensions::Sort ( Span< TKey > &  keys,
Span< TValue > &  values,
const SharedPtr< TComparer > &  comparer 
)

Sorts key-value pairs using a custom comparer (keys and values sorted together)

Template Parameters
TKeyThe type of keys
TValueThe type of values
TComparerThe type of the comparer object
Parameters
keysThe span of keys to sort
valuesThe span of values to sort (maintaining correspondence with keys)
comparerSmart pointer to comparer object for key comparison
Exceptions
ArgumentExceptionif keys and values have different lengths

◆ Sort() [5/5]

template<typename TKey , typename TValue >
void System::MemoryExtensions::Sort ( Span< TKey > &  keys,
Span< TValue > &  values,
System::Comparison< TKey >  comparer 
)

Sorts key-value pairs using a comparison delegate.

Template Parameters
TKeyThe type of keys
TValueThe type of values
Parameters
keysThe span of keys to sort
valuesThe span of values to sort
comparerComparison delegate for key comparison
Exceptions
ArgumentExceptionif keys and values have different lengths

◆ StartsWith() [1/6]

bool System::MemoryExtensions::StartsWith ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  value,
StringComparison  comparisonType 
)

Checks if the character span starts with the specified value span using string comparison.

Parameters
spanThe character span to check
valueThe character span containing values to check for
comparisonTypeThe type of string comparison to perform
Returns
true if the span starts with the value span, false otherwise

◆ StartsWith() [2/6]

bool System::MemoryExtensions::StartsWith ( const ReadOnlySpan< String > &  span,
const char16_t *  val 
)
inline

Checks if a string span starts with the specified character array.

Parameters
spanThe string span to check
valThe character array to check for at the beginning
Returns
true if the span starts with the character array, false otherwise

◆ StartsWith() [3/6]

template<typename T >
bool System::MemoryExtensions::StartsWith ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  value 
)

Checks if the span starts with the specified value span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe span to check
valueThe span containing values to check for at the beginning
Returns
true if the span starts with the value span, false otherwise

◆ StartsWith() [4/6]

template<typename T >
bool System::MemoryExtensions::StartsWith ( const ReadOnlySpan< T > &  span,
const Span< T > &  value 
)

Checks if the read-only span starts with the specified mutable value span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe read-only span to check
valueThe mutable span containing values to check for
Returns
true if the span starts with the value span, false otherwise

◆ StartsWith() [5/6]

template<typename T >
bool System::MemoryExtensions::StartsWith ( const ReadOnlySpan< T > &  span,
const T &  value 
)

Checks if the span starts with the specified value.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to check
valueThe value to check for at the beginning of the span
Returns
true if the span starts with the value, false otherwise

◆ StartsWith() [6/6]

template<typename T >
bool System::MemoryExtensions::StartsWith ( const Span< T > &  span,
const ReadOnlySpan< T > &  value 
)

Checks if the mutable span starts with the specified read-only value span.

Template Parameters
TThe type of elements in the spans
Parameters
spanThe mutable span to check
valueThe read-only span containing values to check for
Returns
true if the span starts with the value span, false otherwise

◆ ToLower()

int32_t System::MemoryExtensions::ToLower ( const ReadOnlySpan< char16_t > &  source,
Span< char16_t > &  destination,
const SharedPtr< Globalization::CultureInfo > &  culture 
)

Converts characters to lowercase using specified culture.

Parameters
sourceThe source character span to convert
destinationThe destination span to store converted characters
cultureThe culture to use for conversion (nullptr for current culture)
Returns
Number of characters converted, or -1 if destination is too small

◆ ToLowerInvariant()

int32_t System::MemoryExtensions::ToLowerInvariant ( const ReadOnlySpan< char16_t > &  source,
Span< char16_t > &  destination 
)

Converts characters to lowercase using invariant culture.

Parameters
sourceThe source character span to convert
destinationThe destination span to store converted characters
Returns
Number of characters converted, or -1 if destination is too small

◆ ToUpper()

int32_t System::MemoryExtensions::ToUpper ( const ReadOnlySpan< char16_t > &  source,
Span< char16_t > &  destination,
const SharedPtr< Globalization::CultureInfo > &  culture 
)

Converts characters to uppercase using specified culture.

Parameters
sourceThe source character span to convert
destinationThe destination span to store converted characters
cultureThe culture to use for conversion (nullptr for current culture)
Returns
Number of characters converted, or -1 if destination is too small

◆ ToUpperInvariant()

int32_t System::MemoryExtensions::ToUpperInvariant ( const ReadOnlySpan< char16_t > &  source,
Span< char16_t > &  destination 
)

Converts characters to uppercase using invariant culture.

Parameters
sourceThe source character span to convert
destinationThe destination span to store converted characters
Returns
Number of characters converted, or -1 if destination is too small

◆ Trim() [1/6]

ReadOnlySpan< char16_t > System::MemoryExtensions::Trim ( const ReadOnlySpan< char16_t > &  span)
inline

Trims whitespace characters from both ends of a character span.

Parameters
spanThe character span to trim
Returns
A new span with whitespace trimmed from both ends

◆ Trim() [2/6]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::Trim ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from both ends of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from both ends

◆ Trim() [3/6]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::Trim ( const ReadOnlySpan< T > &  span,
trimElement 
)

Trims specified element from both ends of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from both ends

◆ Trim() [4/6]

Span< char16_t > System::MemoryExtensions::Trim ( Span< char16_t > &  span)
inline

Trims whitespace characters from both ends of a mutable character span.

Parameters
spanThe mutable character span to trim
Returns
A new span with whitespace trimmed from both ends

◆ Trim() [5/6]

template<typename T >
Span< T > System::MemoryExtensions::Trim ( Span< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from both ends of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from both ends

◆ Trim() [6/6]

template<typename T >
Span< T > System::MemoryExtensions::Trim ( Span< T > &  span,
trimElement 
)

Trims specified element from both ends of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from both ends

◆ TrimEnd() [1/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimEnd ( const ReadOnlySpan< char16_t > &  span)
inline

Trims whitespace characters from the end of a character span.

Parameters
spanThe character span to trim
Returns
A new span with whitespace trimmed from the end

◆ TrimEnd() [2/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimEnd ( const ReadOnlySpan< char16_t > &  span,
char16_t  trimchar 
)
inline

Trims specified character from the end of a character span.

Parameters
spanThe character span to trim
trimcharThe character to trim
Returns
A new span with the specified character trimmed from the end

◆ TrimEnd() [3/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimEnd ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  trimChars 
)
inline

Trims specified characters from the end of a character span.

Parameters
spanThe character span to trim
trimCharsThe characters to trim
Returns
A new span with the specified characters trimmed from the end

◆ TrimEnd() [4/10]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::TrimEnd ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from the end of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from the end

◆ TrimEnd() [5/10]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::TrimEnd ( const ReadOnlySpan< T > &  span,
const T &  trimElement 
)

Trims specified element from the end of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from the end

◆ TrimEnd() [6/10]

Span< char16_t > System::MemoryExtensions::TrimEnd ( Span< char16_t > &  span)
inline

Trims whitespace characters from the end of a mutable character span.

Parameters
spanThe mutable character span to trim
Returns
A new span with whitespace trimmed from the end

◆ TrimEnd() [7/10]

Span< char16_t > System::MemoryExtensions::TrimEnd ( Span< char16_t > &  span,
char16_t  trimchar 
)
inline

Trims specified character from the end of a mutable character span.

Parameters
spanThe mutable character span to trim
trimcharThe character to trim
Returns
A new span with the specified character trimmed from the end

◆ TrimEnd() [8/10]

Span< char16_t > System::MemoryExtensions::TrimEnd ( Span< char16_t > &  span,
const ReadOnlySpan< char16_t > &  trimchars 
)
inline

Trims specified characters from the end of a mutable character span.

Parameters
spanThe mutable character span to trim
trimcharsThe characters to trim
Returns
A new span with the specified characters trimmed from the end

◆ TrimEnd() [9/10]

template<typename T >
Span< T > System::MemoryExtensions::TrimEnd ( Span< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from the end of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from the end

◆ TrimEnd() [10/10]

template<typename T >
Span< T > System::MemoryExtensions::TrimEnd ( Span< T > &  span,
const T &  trimElement 
)

Trims specified element from the end of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from the end

◆ TrimStart() [1/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimStart ( const ReadOnlySpan< char16_t > &  span)
inline

Trims whitespace characters from the start of a character span.

Parameters
spanThe character span to trim
Returns
A new span with whitespace trimmed from the start

◆ TrimStart() [2/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimStart ( const ReadOnlySpan< char16_t > &  span,
char16_t  trimchar 
)
inline

Trims specified character from the start of a character span.

Parameters
spanThe character span to trim
trimcharThe character to trim
Returns
A new span with the specified character trimmed from the start

◆ TrimStart() [3/10]

ReadOnlySpan< char16_t > System::MemoryExtensions::TrimStart ( const ReadOnlySpan< char16_t > &  span,
const ReadOnlySpan< char16_t > &  trimchars 
)
inline

Trims specified characters from the start of a character span.

Parameters
spanThe character span to trim
trimcharsThe characters to trim
Returns
A new span with the specified characters trimmed from the start

◆ TrimStart() [4/10]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::TrimStart ( const ReadOnlySpan< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from the start of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from the start

◆ TrimStart() [5/10]

template<typename T >
ReadOnlySpan< T > System::MemoryExtensions::TrimStart ( const ReadOnlySpan< T > &  span,
const T &  trimElement 
)

Trims specified element from the start of a typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from the start

◆ TrimStart() [6/10]

Span< char16_t > System::MemoryExtensions::TrimStart ( Span< char16_t > &  span)
inline

Trims whitespace characters from the start of a mutable character span.

Parameters
spanThe mutable character span to trim
Returns
A new span with whitespace trimmed from the start

◆ TrimStart() [7/10]

Span< char16_t > System::MemoryExtensions::TrimStart ( Span< char16_t > &  span,
char16_t  trimchar 
)
inline

Trims specified character from the start of a mutable character span.

Parameters
spanThe mutable character span to trim
trimcharThe character to trim
Returns
A new span with the specified character trimmed from the start

◆ TrimStart() [8/10]

Span< char16_t > System::MemoryExtensions::TrimStart ( Span< char16_t > &  span,
const ReadOnlySpan< char16_t > &  trimchars 
)
inline

Trims specified characters from the start of a mutable character span.

Parameters
spanThe mutable character span to trim
trimcharsThe characters to trim
Returns
A new span with the specified characters trimmed from the start

◆ TrimStart() [9/10]

template<typename T >
Span< T > System::MemoryExtensions::TrimStart ( Span< T > &  span,
const ReadOnlySpan< T > &  trimElements 
)

Trims specified elements from the start of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementsThe elements to trim
Returns
A new span with the specified elements trimmed from the start

◆ TrimStart() [10/10]

template<typename T >
Span< T > System::MemoryExtensions::TrimStart ( Span< T > &  span,
const T &  trimElement 
)

Trims specified element from the start of a mutable typed span.

Template Parameters
TThe type of elements in the span
Parameters
spanThe mutable span to trim
trimElementThe element to trim
Returns
A new span with the specified element trimmed from the start