Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

String StartsWith seems to have trouble with unicode character 712

$
0
0

Hi,

In the following code

string ex = "bˈ";
if (ex.StartsWith(ex[0].ToString(), StringComparison.CurrentCulture))
{
     Console.WriteLine("correct");
}
else
{
     Console.WriteLine("wrong");
}

It returns wrong when the second character of the string ex is Unicode character 712

I have tested with a number of other Unicode characters all of which work as expected

Any ideas why this particular Unicode character breaks StartsWith?


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>