I want to get the first place where 2 string vary from each other. example: for these two strings: \"AAAB\" \"AAAAC\"
I want to get the result 4.
How do i d
int index; int len = Math.Min(string1.Length, string2.Length); for (index = 0; index < len; index++) if (string1[index] != string2[index]) break;
This would provide "3" for your example (zero-based indexing), so just increment the result by one.