Java tutorial
/* 2) Index Of Difference between ABCXYZ and ABCPQR >>>3 */ import org.apache.commons.lang.StringUtils; public class StringUtilsTrial { public static void main(String[] args) { // Returns index where the Strings start to differ System.out.println("2) Index Of Difference between ABCXYZ and ABCPQR >>>" + StringUtils.indexOfDifference("ABCXYZ", "ABCPQR")); } }