ReadOnlySpanSlicing.SliceBefore Method
- Namespace
- Kampute.DocToolkit.Support
- Assembly
- Kampute.DocToolkit.dll
Definition
Gets a slice of the span before the first occurrence of the specified separator.
public static ReadOnlySpan<T> SliceBefore<T>(this ReadOnlySpan<T> span, T separator)
where T : IEquatable<T>Type Parameters
T- The type of the elements in the span.
Parameters
spanReadOnlySpan<T>- The read-only span to slice.
separatorT- The separator to find in the span.
Returns
- ReadOnlySpan<T>
- A read-only span that ends before the first occurrence of the separator, or an empty span if the separator is not found.
