-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Description
string.Contains returns unexpected results when called on an empty string on iOS. This is the code in question:
"".Contains("ö", StringComparison.CurrentCultureIgnoreCase);
Results:
.net 8:
.net 9:
Project to reproduce the issue:
https://github.com/markuspalme/dotnetruntime-contains
Reproduction Steps
To reproduce the issue, call string.Containson an empty string and run the code on net9-ios:
"".Contains("ö", StringComparison.CurrentCultureIgnoreCase);
Expected behavior
The result should be false, an empty string does certainly not contain a character.
Actual behavior
On .net 9 the call returns true.
Regression?
This is a regression, the same code returns false on .net 8.
Known Workarounds
No response
Configuration
.net SDK 9.0.100 running on iOS 18.1 ARM64.
Other information
No response

