C# String.IndexOf matching at the beginning.
It thorws me off base when String.IndexOf finds a matching string at the beginning of the string and returns 0 (zero) as the position.
Ex:
String aString = "L1 OR L3 or L2"
What would be the value from, aString.IndexOf("L1")? It is 0.
As per MSDN documentation,
The index position of value if that string is found, or -1 if it is not. If value is Empty, the return value is 0. - This does not seem right?
|