Here you can find the source of areStringsEqual(String s1, String s2, boolean caseInsensitive)
public static boolean areStringsEqual(String s1, String s2, boolean caseInsensitive)
//package com.java2s; //License from project: Apache License public class Main { public static boolean areStringsEqual(String s1, String s2) { return areStringsEqual(s1, s2, false); }/*w w w .j a v a 2 s . com*/ 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, boolean caseInsensitive, boolean dontDistinctNullAndEmpty) { if (dontDistinctNullAndEmpty && (s1 == null || s1.length() == 0)) return s2 == null || s2.length() == 0; return areStringsEqual(s1, s2, caseInsensitive); } }