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

/**
 *  Gets the String value as boolean.//from   ww w.j av a  2 s  .  co  m
 */
public final static boolean getStringAsBoolean(String value) {
    return value == null ? false : ((value.equalsIgnoreCase("YES") || value.equalsIgnoreCase("TRUE")));
}

From source file:Main.java

public static boolean isEqualIgnoreCase(final String s1, final String s2) {
    return s1 != null ? s1.equalsIgnoreCase(s2) : s2 == null;
}

From source file:Main.java

public static int[] readIntArray(String s) {
    if ((s == null) || (s.equalsIgnoreCase(""))) {
        return null;
    }/*from  ww w . j a v a 2s. c  om*/

    String[] ints = s.split(" ");
    if ((ints == null) || (ints.length == 0)) {
        return null;
    }

    int[] r = new int[ints.length];
    int i = 0;
    for (String ss : ints) {
        r[i++] = Integer.parseInt(ss);
    }
    return r;
}

From source file:Main.java

/**
 * returns the default file extension for the built artifact of a given packaging type
 * //from w w  w . ja va 2s  .  co m
 * @param packaging
 * @return
 */
private static String getFileExtensionForPackaging(String packaging) {
    if (packaging.equalsIgnoreCase(PACKAGING_BUNDLE) || packaging.equalsIgnoreCase(PACKAGING_JAR)) {
        return ".jar";
    } else if (packaging.equalsIgnoreCase(PACKAGING_WAR)) {
        return ".war";
    } else {
        return ".jar";
    }
}

From source file:Main.java

/**
 * @param n Node to look under/*w  w  w.  j  ava 2 s  .co  m*/
 * @return true if the given node contains any #text children
 */
public static boolean isTextNode(Node n) {
    for (Node ele = n.getFirstChild(); ele != null; ele = ele.getNextSibling()) {
        String name = ele.getNodeName();
        if (!name.equalsIgnoreCase("#text"))
            return false;
    }
    return true;
}

From source file:Main.java

static public String readSharePerf(String tag) {
    SharedPreferences pref = activity.getSharedPreferences(tag, Context.MODE_PRIVATE);
    String data = pref.getString(tag, "");

    if (data.equalsIgnoreCase(""))
        return null;
    else/*from   w  ww. j  a v a  2 s.com*/
        return data;
}

From source file:Main.java

public static boolean filter(String str) {
    if (str.equalsIgnoreCase("InputPerson")) {
        return true;
    } else if (str.equalsIgnoreCase("UpdatePerson")) {
        return true;
    } else if (str.equalsIgnoreCase("ActiveFlag")) {
        return true;
    } else if (str.equalsIgnoreCase("UpdateDate")) {
        return true;
    } else if (str.equalsIgnoreCase("InputDate")) {
        return true;
    } else if (str.equalsIgnoreCase("SubsystemName")) {
        return true;
    } else if (str.equalsIgnoreCase("Class")) {
        return true;
    } else if (str.equalsIgnoreCase("FeederCode")) {
        return true;
    } else if (str.equalsIgnoreCase("FeederCodeEx")) {
        return true;
    } else if (str.equalsIgnoreCase("DatasetName")) {
        return true;
    } else if (str.equalsIgnoreCase("DatasetType")) {
        return true;
    }/* w w w .  j  a  v  a 2s . co  m*/
    return false;
}

From source file:com.ltb.Main.java

/** 
 * Check extension of file to check whether is a right file movie
 * TODO: To be improved /*  w ww  . j a va2 s .  c o  m*/
 * @param extension
 * @return
 */
private static boolean isFilmExtension(String extension) {
    if (extension.equalsIgnoreCase("mkv") || extension.equalsIgnoreCase("mp4")
            || extension.equalsIgnoreCase("m4v") || extension.equalsIgnoreCase("avi")
            || extension.equalsIgnoreCase("m2ts") || extension.equalsIgnoreCase("mpg")) {
        return true;
    } else {
        return false;
    }
}

From source file:Main.java

public static String getTextWithoutTrim(Node n) {
    StringBuffer sb = new StringBuffer();
    for (Node ele = n.getFirstChild(); ele != null; ele = ele.getNextSibling()) {
        String name = ele.getNodeName();
        if (name.equalsIgnoreCase("#text"))
            sb.append(ele.getNodeValue());
    }// www .  j  a  v  a2s  .c  o  m
    return sb.toString();
}

From source file:Main.java

public static boolean IsLanguageCN() {
    String language = Locale.getDefault().getLanguage();
    if (language.equalsIgnoreCase("zh") || language.equalsIgnoreCase("cn"))
        return true;
    return false;
}