The following code works on "everyones" machine, except for mine:
var foo = "caa"; var bar = "ca"; if (foo.StartsWith(bar, false, CultureInfo.GetCultureInfo("no"))) Console.WriteLine($"{foo} starts with {bar}"); else { Console.WriteLine($"{foo} does not start with {bar}"); } I've tried in on .net 5.0.400, 5.0.403, 6.0.100 - all prints 'caa does not start with ca'. I've not copied the chars from anywhere, I literally type them out.
I understand that this is really just on my computer, but I do not understand why or what is causing this.
Edit: I'm on Windows 10 - OS Build: 19043.1348. nb-NO keyboard, en-US Windows UI language.
Edit: Added if (foo.StartsWith(bar, false, CultureInfo.GetCultureInfo("no") - no change in behavior.
aais treated as an accentedafoo.StartsWith(bar, StringComparison.Ordinal)?aaequal to in Norway?if (foo.StartsWith(bar, false, CultureInfo.GetCultureInfo("no")))"caa does not start with ca"