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

public static String textContains(String text) {
    return format("contains(%s, '%s')", translateTextForPath("text()"), text.toLowerCase());
}

From source file:Main.java

public static String getExtension(String filename) {
    String filenameArray[] = filename.split("\\.");

    if (filenameArray.length <= 1) {
        //  no extension
        return "";
    }//from  w  w w. ja  va 2 s .c om

    String extension = filenameArray[filenameArray.length - 1];
    extension = extension.toLowerCase();
    return extension;
}

From source file:Main.java

/**
 * Returns the content type for the given filePath.
 *///w w w  .j a v  a 2s . c  o m
public static String getContentTypeForFilePath(String filePath) {
    filePath = filePath.toLowerCase();

    if (filePath.endsWith(".gif")) {
        return "image/gif";
    }
    if (filePath.endsWith(".jpg") || filePath.endsWith(".jpeg")) {
        return "image/jpeg";
    }
    if (filePath.endsWith(".png")) {
        return "image/png";
    }

    if (filePath.endsWith(".apk")) {
        return "application/vnd.android.package-archive; charset=utf-8";
    }

    if (filePath.endsWith(".zip")) {
        return "application/zip; charset=utf-8";
    }

    if (filePath.endsWith(".keystore")) {
        return "application/octet-stream";
    }

    // default
    return "text/plain; charset=utf-8";
}

From source file:Main.java

public static String getStringByCaseInsensitive(Bundle bundle, String key) {
    Set<String> keys = bundle.keySet();
    String lower = key.toLowerCase();
    for (String k : keys) {
        if (k.toLowerCase().equals(lower))
            return bundle.getString(k);
    }/*from w ww  .  j a  v a 2  s  .  c o m*/

    return null;
}

From source file:Main.java

public static boolean isSupportedByRegionDecoder(String mimeType) {
    if (mimeType == null)
        return false;
    mimeType = mimeType.toLowerCase();
    return mimeType.startsWith("image/") && (!mimeType.equals("image/gif"));
}

From source file:com.fluke.application.IEODReader.java

private static void process(String stockName, List<String> lines) {
    List<IntradayTicker> tickers = new ArrayList<>();
    for (String line : lines) {
        if (line.toLowerCase().contains("<ticker>")) {
            continue;
        }//  w  w w  .j  av  a  2  s  .c o m
        String parts[] = line.split(",");
        IntradayTicker ticker = new IntradayTicker();
        ticker.setTime(getTimestamp(parts[1], parts[2]));
        ticker.setOpenPrice(Float.parseFloat(parts[3]));
        ticker.setHighPrice(Float.parseFloat(parts[4]));
        ticker.setLowPrice(Float.parseFloat(parts[5]));
        ticker.setClosePrice(Float.parseFloat(parts[6]));
        ticker.setVolume(Integer.parseInt(parts[7]));
        tickers.add(ticker);
        stockName = parts[0];
    }
    new IntraDayDao().insertBatch(stockName, tickers);
}

From source file:Main.java

/**
 * Determines if the VM supports encoding (chars to bytes) the
 * specified character set. NOTE: the given character set name may
 * not be known to the VM even if this method returns <code>true</code>.
 * Use {@link #toJavaCharset(String)} to get the canonical Java character
 * set name./*from  ww  w.j  a va 2s.c o  m*/
 *
 * @param charsetName the characters set name.
 * @return <code>true</code> if encoding is supported, <code>false</code>
 *         otherwise.
 */
public static boolean isEncodingSupported(String charsetName) {
    return encodingSupported.contains(charsetName.toLowerCase());
}

From source file:Main.java

/**
 * Determines if the VM supports decoding (bytes to chars) the 
 * specified character set. NOTE: the given character set name may 
 * not be known to the VM even if this method returns <code>true</code>.
 * Use {@link #toJavaCharset(String)} to get the canonical Java character
 * set name./*from  ww  w .j  a v a 2  s  .c  o m*/
 * 
 * @param charsetName the characters set name.
 * @return <code>true</code> if decoding is supported, <code>false</code>
 *         otherwise.
 */
public static boolean isDecodingSupported(String charsetName) {
    return decodingSupported.contains(charsetName.toLowerCase());
}

From source file:Main.java

public static String toStandart(final String name) {
    String result = name.replaceAll("([a-z\\d])([A-Z])", "$1-$2").replace('_', '-');
    result = result.toLowerCase();
    return result;
}

From source file:Main.java

public static String textStartsWith(String text) {
    return format("starts-with(%s, '%s')", translateTextForPath("text()"), text.toLowerCase());
}