x is a string in any language/culture and want to find the last dot in the string:
int y = x.LastIndexOf(".");
Is the result (y) culture independent or not? Why?
x is a string in any language/culture and want to find the last dot in the string:
int y = x.LastIndexOf(".");
Is the result (y) culture independent or not? Why?
LastIndexOf
is culture insensitive. The value is matched if the unicode values of the characters are the same.
You can find more information on this in the Remarks section of Microsoft Docs.
In order to perform a culture-specific char search you'll have to make use of CompareInfo.LastIndexOf