private Utf8String TrimHelper(TrimType trimType) { Utf8Span trimmedSpan = this.AsSpan().TrimHelper(trimType); // Try to avoid allocating a new Utf8String instance if possible. // Otherwise, allocate a new substring wrapped around the resulting slice. return((trimmedSpan.Length == this.Length) ? this : trimmedSpan.ToUtf8String()); }