Example usage for java.lang String equalsIgnoreCase

List of usage examples for java.lang String equalsIgnoreCase

Introduction

In this page you can find the example usage for java.lang String equalsIgnoreCase.

Prototype

public boolean equalsIgnoreCase(String anotherString) 

Source Link

Document

Compares this String to another String , ignoring case considerations.

Usage

From source file:Main.java

public static boolean isFileChooser(String value) {
    if (value.equalsIgnoreCase("filechooser")) {
        return true;
    }//from ww  w .  j av a2 s. c  om
    try {
        File file = new File(value);
        if (file.exists()) {
            return true;
        }
    } catch (Throwable e) {
    }
    return false;
}

From source file:Main.java

public static boolean isAudioAllowRead(String suffix) {

    String[] suffixs = { ".aac", ".amr", ".mp3", ".wma", ".mod", ".mid", ".ogg" };
    for (String s : suffixs) {
        if (s.equalsIgnoreCase(suffix)) {
            return true;
        }/* w  w  w  . j  a  va 2  s  .com*/
    }
    return false;
}

From source file:Main.java

public static boolean isOfficeAllowRead(String suffix) {

    String[] suffixs = { ".doc", ".docx", ".xls", ".xlsx", ".pptx", ".ppt", ".txt", ".pdf" };
    for (String s : suffixs) {
        if (s.equalsIgnoreCase(suffix)) {
            return true;
        }/*from  w w  w.  j a v  a 2s. co  m*/
    }
    return false;
}

From source file:Main.java

public static String num2boolean(String obj) {
    if ("1".equals(obj) || obj.equalsIgnoreCase("true")) {
        return "true";
    } else {//w w w .java 2 s.com
        return "false";
    }

}

From source file:Main.java

public static boolean getBool(String str, boolean b) {
    return null != str && str.equalsIgnoreCase("true") ? true : false;
}

From source file:Main.java

public static boolean containsStringIgnoreCase(final Iterable<String> collection, final String value) {
    boolean contained = false;
    for (String s : collection) {
        if (s.equalsIgnoreCase(value)) {
            contained = true;//from   w w w. j ava2 s  .co m
            break;
        }
    }
    return contained;
}

From source file:Main.java

public static boolean contains(String[] array, String what) {
    for (String element : array) {
        if (element.equalsIgnoreCase(what)) {
            return true;
        }/*  w  w w  .  j  ava 2s .c  om*/
    }

    return false;
}

From source file:Main.java

public static boolean notEmptyOrNull(String string) {
    if (string != null && !string.equalsIgnoreCase("null") && string.trim().length() > 0) {
        return true;
    } else {//  w  ww. j  av  a2 s  . c  o  m
        return false;
    }
}

From source file:Main.java

private static boolean algEquals(String algURI, String algName) {
    if (algName.equalsIgnoreCase("DSA") && algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) {
        return true;
    } else if (algName.equalsIgnoreCase("RSA") && algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1)) {
        return true;
    } else {/*from  w  w w.j  a  v  a2 s.  c o m*/
        return false;
    }
}

From source file:Main.java

public static int getFormatIntByBool(String bool) {
    try {/*from   ww w .jav  a 2 s  .  c  o  m*/
        return (bool.equalsIgnoreCase("true")) ? 1 : 0;
    } catch (Exception ex) {
        return 0;
    }
}