StringUtils: indexOfDifference(String str1, String str2)
/*
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"));
}
}
Apache-Common-Lang.zip( 248 k)Related examples in the same category