Java String Difference differenceEncoded(String es1, String es2)

Here you can find the source of differenceEncoded(String es1, String es2)

Description

difference Encoded

License

Open Source License

Declaration

static int differenceEncoded(String es1, String es2)
     

Method Source Code

//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;
        /*     */ }
}

Related

  1. difference(String str1, String str2)
  2. difference(String string1, String string2)
  3. difference(String xpath1, String xpath2)
  4. differenceAt(String s1, String s2)
  5. differenceEncoded(String es1, String es2)