Example usage for java.lang String toLowerCase

List of usage examples for java.lang String toLowerCase

Introduction

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

Prototype

public String toLowerCase() 

Source Link

Document

Converts all of the characters in this String to lower case using the rules of the default locale.

Usage

From source file:Main.java

private static int keyStrokeModMac(String keyStrokeStr) {
    keyStrokeStr = keyStrokeStr.toLowerCase();
    int mod = 0;//from  w  ww  . j av  a 2 s .  c  om
    if (keyStrokeStr.contains("ctrl") || keyStrokeStr.contains("control")) {
        mod = mod | InputEvent.CTRL_MASK;
    }
    if (keyStrokeStr.contains("alt")) {
        mod = mod | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
    }
    if (keyStrokeStr.contains("meta")) {
        mod = mod | InputEvent.ALT_MASK;
    }
    return mod;
}

From source file:Main.java

static boolean isVLCAudioMimeType(String mimeType) {
    return is_part_of(AUDIO_WITNESS, mimeType.toLowerCase());

}

From source file:Main.java

public static boolean isStringValidURL(String str) {
    return isValidString(str)
            && (str.toLowerCase().startsWith("http://") || str.toLowerCase().startsWith("https://"));
}

From source file:Main.java

public static String sanitizeTextAsDomId(final String text) {
    //TODO: Full implementation
    return text.toLowerCase().replace(" ", "-");
}

From source file:Main.java

public static void iapAddProduct(String name, int ID, int type) {
    name = name.toLowerCase();
    Log.w("IAB AddProduct", "Adding: " + name + " to ID: " + Integer.toString(ID));
    if (ID < 0 || ID >= MAX_PRODUCTS)
        return;//from  w  w w . ja v  a 2s .  c o m
    g_iPurchaseProductStates[ID] = 0;
    g_sPurchaseProductNames[ID] = name;
    g_iPurchaseProductTypes[ID] = type;
    Log.w("IAB AddProduct", "Added: " + name);
    if (ID + 1 > g_iNumProducts)
        g_iNumProducts = ID + 1;
}

From source file:Main.java

static boolean isStringValidURL(String str) {
    return isValidString(str)
            && (str.toLowerCase().startsWith("http://") || str.toLowerCase().startsWith("https://"));
}

From source file:Main.java

public static String makeProperFormat(String iString) {
    iString = iString.trim();//from   ww  w.  j a  va2 s  . c  o m
    iString = iString.toLowerCase();
    iString = iString.substring(0, 1).toUpperCase() + iString.substring(1);
    return iString;
}

From source file:Main.java

/**
 * Return well-written format for Bio2RDF REST service
 * //from w  w  w  . j a  va  2 s .c  o m
 * 
 * {talendTypes} String
 * 
 * {Category} User Defined
 * 
 * {param} string("format")
 * 
 * {example} restFormat("rdf")
 */
public static String getMimeFromFormat(String formatIn) {
    if (formatIn.toLowerCase().equals("rdf") || formatIn.toLowerCase().equals("rdfxml")) {
        return ("application/rdf+xml");
    } else if (formatIn.toLowerCase().equals("n3")) {
        return ("text/rdf+n3");
    } else if (formatIn.toLowerCase().equals("ttl") || formatIn.toLowerCase().equals("turtle")) {
        return ("text/turtle");
    } else if (formatIn.toLowerCase().equals("nt")) {
        return ("text/plain");
    } else if (formatIn.toLowerCase().equals("json")) {
        return ("application/json");
    } else if (formatIn.toLowerCase().equals("jsonld")) {
        return ("application/ld+json");
    } else if (formatIn.toLowerCase().equals("trig")) {
        return ("application/trig");
    } else {
        return ("null");
    }
}

From source file:Main.java

private static synchronized boolean isAlreadyContained(String bank, String targ) {
    bank = "#~#" + bank;
    if (bank.toLowerCase().indexOf("#~#" + targ.toLowerCase() + "&#") != -1) {
        return true;
    }/* w  w  w  .j  ava  2 s  . c  o  m*/
    return false;
}

From source file:Main.java

private static final String determineMimeType(String location) {

    String s = location.toLowerCase().trim();
    if (s.endsWith("png"))
        return "image/png";

    if (s.endsWith("gif"))
        return "image/gif";

    if (s.endsWith("jpg") || s.endsWith("jpeg"))
        return "image/jpeg";

    return "image/gif"; // default

}