Compare two String to see if they are equals ignoring the case and the blank spaces (both null is ok).

@param s1 string
@param s2 string
@return if two String are equals ignoring the case and the blank spaces
335507
public static boolean areEqualsIgnoreCaseAndTrim(final String s1, final String s2) {
        if (s1 == null && s2 == null) {
            return true;
        } else if (s1 != null && s2 != null) {
            return s1.trim().equalsIgnoreCase(s2.trim());
        } else {
            return false;
        }
    }
581102
protected final boolean compareKeys(K k1, K k2) {
        return k1 == k2 || (k1 != null && k1.equals(k2));
    }
1218691
public static boolean isSame(List<URL> urls1, List<URL> urls2) {
        if (urls1 == null || urls2 == null) {
            return false;
        }
        if (urls1.size() != urls2.size()) {
            return false;
        }
        return urls1.containsAll(urls2);
    }
183290
public static int difference(String s1, String s2) {

        /** @todo: check if this is the standard algorithm */
        if ((s1 == null) || (s2 == null)) {
            return 0;
        }

        s1 = soundex(s1);
        s2 = soundex(s2);

        int e = 0;

        for (int i = 0; i < 4; i++) {
            if (s1.charAt(i) != s2.charAt(i)) {
                e++;
            }
        }

        return e;
    }
180103
@Override
  public int compare(String s1, String s2) {
    if (s1 == s2) { // NOSONAR false-positive: Compare Objects With Equals
      return 0;
    }
    int h1 = s1.hashCode();
    int h2 = s2.hashCode();
    if (h1 < h2) {
      return -1;
    } else if (h1 > h2) {
      return 1;
    } else {
      return s1.compareTo(s2);
    }
  }
938190
public static boolean equalsIgnoreCase(String str1, String str2) {
        return (str1 == null || str2 == null)
                ? false
                : (str1 == str2 || lowerCaseInternal(str1).equals(lowerCaseInternal(str2)));
    }
1358242
public static boolean equalsText(String s1, String s2) {
		if (s1 == null) {
			if (s2 != null) {
				return false;
			}
		} else {
			if (s2 == null) {
				return false;
			}
		}
		if ((s1 != null) && (s2 != null)) {
			s1 = s1.replaceAll("\\s", "").toLowerCase();
			s2 = s2.replaceAll("\\s", "").toLowerCase();
			if (!s1.equals(s2)) {
				return false;
			}
		}
		return true;
	}
690422
def compare(string1, string2):
    
    if len(string1) != len(string2):
        return False
    result = True
    for c1, c2 in izip(string1, string2):
        result &= c1 == c2
    return result
500501
public static boolean isEqualSeq(final String first, final String second, final String delimiter) {
    if (isNotEmpty(first) && isNotEmpty(second)) {
      String[] firstWords = split(first, delimiter);
      Set<String> firstSet = CollectUtils.newHashSet();
      for (int i = 0; i < firstWords.length; i++) {
        firstSet.add(firstWords[i]);
      }
      String[] secondWords = split(second, delimiter);
      Set<String> secondSet = CollectUtils.newHashSet();
      for (int i = 0; i < secondWords.length; i++) {
        secondSet.add(secondWords[i]);
      }
      return firstSet.equals(secondSet);
    } else {
      return isEmpty(first) & isEmpty(second);
    }
  }
1352917
def is_equal(self, string1, string2):
        '''  '''
        return string1.lower().strip() == string2.lower().strip()
987684
private boolean startsWithIgnoreCase(String str1, String str2) {
        return str1 != null && str2 != null && str1.toUpperCase().startsWith(str2.toUpperCase());
    }
208520
@Pure
	protected int compareSegments(ST s1, ST s2) {
		assert s1 != null && s2 != null;
		return s1.hashCode() - s2.hashCode();
	}
115944
public static <T> int compare(IntStream s1, IntStream s2)
    {
        return compare(s1, s2, null);
    }
268196
private boolean isEqual(String str1, String str2) {
		if (StringUtils.isEmpty(str1) && StringUtils.isEmpty(str2)) {
			return true;
		} else if (!StringUtils.isEmpty(str1)) {
			return str1.equals(str2);
		} else {
			return false;
		}
	}
644800
public static boolean equalsValue(final Object o1, final Object o2) {
        if (o1 == null) {
            return o2 == null;
        }
        return o1.equals(o2);
    }
1273082
public static boolean areStringsEqual(String s1, String s2) {
    return s1 != null && s1.equals(s2) || s1 == null && s2 == null;
  }
1024240
public boolean areEquals(String str1, String str2) {

		return (str1 == null && str2 == null || str1 != null && str2 != null && str1.equals(str2));
	}