Skip to content

.Net 5: For Thai, IndexOf(string) returns wrong index for some strings #59120

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[regression] [worked-in:.net core 3.1]
Using .NET 5 IndexOf(string) returns wrong index.
This is reproducible only for some input strings, when the culture is set to Thai.

Example:
CultureInfo.CurrentCulture = new CultureInfo("th");
var idxSeparator = "27".IndexOf("."); // returns 0 instead of -1
idxSeparator = "0".IndexOf("."); // returns -1 as expected
idxSeparator = "3".IndexOf("."); // returns -1 as expected
idxSeparator = "3345".IndexOf("."); // returns 0 instead of -1

Notes

  • in .netcore3.1 it returned -1 for all examples above (as I would expect)
  • In other languages this is not reproducible also in .Net 5
  • Indexof(char) does not have this problem

Original Comments

Feedback Bot on 9/7/2021, 01:21 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions