Here you can find the source of differenceEncoded(String es1, String es2)
static int differenceEncoded(String es1, String es2)
//package com.java2s; //License from project: Open Source License public class Main { static int differenceEncoded(String es1, String es2) /* */ {//from w w w . j ava 2s . co m /* 111 */ if ((es1 == null) || (es2 == null)) { /* 112 */ return 0; /* */ } /* 114 */ int lengthToMatch = Math.min(es1.length(), es2.length()); /* 115 */ int diff = 0; /* 116 */ for (int i = 0; i < lengthToMatch; i++) { /* 117 */ if (es1.charAt(i) == es2.charAt(i)) { /* 118 */ diff++; /* */ } /* */ } /* 121 */ return diff; /* */ } }