Skip to content

StringSegment.EndsWith inconsistent (buggy?) behavior #39140

@adams85

Description

@adams85

Description

Console.WriteLine("/".StartsWith("/", StringComparison.Ordinal));
// prints True

Console.WriteLine(new StringSegment("/").StartsWith("/", StringComparison.Ordinal));
// prints True

Console.WriteLine("/".EndsWith("/", StringComparison.Ordinal));
// prints True

Console.WriteLine(new StringSegment("/").EndsWith("/", StringComparison.Ordinal));
// prints False !!!

Is this by design or simply a bug?

Configuration

.NET Core 3.1.5, Windows 10 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Primitivesbuggood first issueIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions