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 do it in C#?
.NET 4:
string a1 = "AAAB"; string a2 = "AAAAC"; int index = a1.Zip(a2, (c1, c2) => c1 == c2).TakeWhile(b => b).Count() + 1;
1.4m articles
1.4m replys
5 comments
57.0k users