Check two nullable string for equal - Android java.lang

Android examples for java.lang:String Equals

Description

Check two nullable string for equal

Demo Code

public class Main{

    public static boolean equals(String str1, String str2) {
        return str1 == str2 || str1 != null && str1.equals(str2);
    }/*from w ww  .  jav a  2  s.c  om*/

}

Related Tutorials