private static boolean compareLevenshtein(final String str1,final String str2,final int limit){
  if (str1.equalsIgnoreCase(str2)) {
    return true;
  }
 else   if (limit < 1) {
    return false;
  }
 else {
    final int dist=limitedLevenshtein(str1.toLowerCase(),str2.toLowerCase(),0,0,limit);
    return dist <= limit;
  }
}

private static boolean compareLevenshtein ( final String str1 , final String str2 , final int limit ) { if ( str1 . equalsIgnoreCase ( str2 ) ) { return true ; } else if ( limit < 1 ) { return false ; } else { final int dist = limitedLevenshtein ( str1 . toLowerCase ( ) , str2 . toLowerCase ( ) , 0 , 0 , limit ) ; return dist <= limit ; } }
calculate the number of differing characters between to non - null strings . comparison is case insensitive .
