Here you can find the source of areEqualsIgnoreCaseAndTrim(final String s1, final String s2)
Parameter | Description |
---|---|
s1 | string |
s2 | string |
public static boolean areEqualsIgnoreCaseAndTrim(final String s1, final String s2)
//package com.java2s; //License from project: Apache License public class Main { /**//w w w . ja va 2 s. com * 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 */ 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; } } }