<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.6.25358.103" />

SpanHelpers

static class SpanHelpers
public static void CopyAndTerminate(this ReadOnlySpan<char> source, Span<char> destination)

Copies the source to the destination, terminating with null and truncating source to fit if necessary.

public static ReadOnlySpan<char> SliceAtFirstNull(this ReadOnlySpan<char> span)

Slices the given span at the first null found (if any).

public static Span<char> SliceAtFirstNull(this Span<char> span)

Slices the given span at the first null found (if any).