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 ; }
functional compare for two strings as ignore - case text