Skip to content

Implementation of extension method causes ArgumentOutOfRangeException #58074

@buko1234

Description

@buko1234

Actual implementation of "internal static ReadOnlyMemory TrimStart(this ReadOnlyMemory memory)" method in MemoryExtensions.cs causes ArgumentOutOfRangeException if there is any whitespace character at the beginning of argument.
Last line should say:
return memory.Slice(index, span.Length - index);
instead of
return memory.Slice(index, span.Length);

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions