How to compare 2 strings & print difference?

@abhi_25690
If you want to capture everything after the first difference, use
var intDiffIndex = String.Compare(string1, string2).
The output of this will be the index of the first difference. Then use Substring method to get the additional text,
var difference = string1.substring(intDiffIndex)

But if you want all the differences, then check the below post.

Hope this helps!

2 Likes