I am strugling with getting the index of sequence "\a\b" in string. Any idea how to do it? I am doing following:
string expr = "Hello\a\b";
Console.WriteLine(expr.IndexOf("\a\b"));
This code returns 0 instead of expected 5
I am strugling with getting the index of sequence "\a\b" in string. Any idea how to do it? I am doing following:
string expr = "Hello\a\b";
Console.WriteLine(expr.IndexOf("\a\b"));
This code returns 0 instead of expected 5
string expr = "Hello\a\b";
var inx = expr.IndexOf("\a\b", StringComparison.Ordinal);
Refer to documentation https://learn.microsoft.com/en-us/dotnet/api/System.StringComparison?view=net-6.0