string.Contains returns wrong result on net-ios with .net 9 #110609
Open
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.Contains
on 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