Here you can find the source of areStringsEqual(String s1, String s2, boolean caseInsensitive, boolean dontDistinctNullAndEmpty)
public static boolean areStringsEqual(String s1, String s2, boolean caseInsensitive, boolean dontDistinctNullAndEmpty)
//package com.java2s; //License from project: Apache License public class Main { public static boolean areStringsEqual(String s1, String s2, boolean caseInsensitive, boolean dontDistinctNullAndEmpty) { if (dontDistinctNullAndEmpty) { if (s1 == null || s1.length() == 0) return s2 == null || s2.length() == 0; }//from w ww. jav a2 s . c o m return areStringsEqual(s1, s2, caseInsensitive); } public static boolean areStringsEqual(String s1, String s2, boolean caseInsensitive) { if (s1 == null) return s2 == null; if (caseInsensitive) return s1.equalsIgnoreCase(s2); else return s1.equals(s2); } public static boolean areStringsEqual(String s1, String s2) { return areStringsEqual(s1, s2, false); } }