Class MemoryExtensions

Defines some extensions over the System.ReadOnlySpan<> type

Inheritance
System.Object
MemoryExtensions
Namespace: Solti.Utils.Primitives
Assembly: Solti.Utils.Primitives.dll
Syntax
public static class MemoryExtensions : Object

Methods

GetHashCode(ReadOnlySpan<Char>, Boolean, Int32)

Hashes the given character span using MURMUR hash

Declaration
public static int GetHashCode(this ReadOnlySpan<char> self, bool ignoreCase, int seed = 1986)
Parameters
Type Name Description
System.ReadOnlySpan<System.Char> self
System.Boolean ignoreCase
System.Int32 seed
Returns
Type Description
System.Int32

IndexOfAnyExcept(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

Returns the index of the first character that is not in the searchValues.

Declaration
public static int IndexOfAnyExcept(this ReadOnlySpan<char> span, ReadOnlySpan<char> searchValues)
Parameters
Type Name Description
System.ReadOnlySpan<System.Char> span
System.ReadOnlySpan<System.Char> searchValues
Returns
Type Description
System.Int32

IndexOfAnyExcept(ReadOnlySpan<Char>, ReadOnlySpan<Char>, ref MemoryExtensions.ParsedSearchValues)

Returns the index of the first character that is not in the searchValues.

Declaration
public static int IndexOfAnyExcept(this ReadOnlySpan<char> span, ReadOnlySpan<char> searchValues, ref MemoryExtensions.ParsedSearchValues parsedSearchValues)
Parameters
Type Name Description
System.ReadOnlySpan<System.Char> span
System.ReadOnlySpan<System.Char> searchValues
MemoryExtensions.ParsedSearchValues parsedSearchValues
Returns
Type Description
System.Int32
Remarks

If searchValues is not null this method assigns the parsedSearchValues which can be used to speed up subsequent calls (against the same search values)

In This Article
Back to top Generated by DocFX