Example usage for java.lang String toUpperCase

List of usage examples for java.lang String toUpperCase

Introduction

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

Prototype

public String toUpperCase() 

Source Link

Document

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

Usage

From source file:Main.java

public static int convertMonthToDigit(String month) {
    month = month.toUpperCase();

    if (month.equals("JAN")) {
        return 0;
    }//from   w  w w . j a v a2  s . c  o m

    else if (month.equals("FEB")) {
        return 1;
    } else if (month.equals("MAR")) {
        return 2;
    } else if (month.equals("APR")) {
        return 3;
    } else if (month.equals("MAY")) {
        return 4;
    } else if (month.equals("JUN")) {
        return 5;
    } else if (month.equals("JUL")) {
        return 6;
    } else if (month.equals("AUG")) {
        return 7;
    } else if (month.equals("SEP")) {
        return 8;
    } else if (month.equals("OCT")) {
        return 9;
    } else if (month.equals("NOV")) {
        return 10;
    } else if (month.equals("DEC")) {
        return 11;
    } else {
        Log.d("ConvertUtil", "convertMonthToDigit = wasnt passed proper stuff");
        return 0;
    }
}

From source file:Main.java

public static boolean checkDataHexa(String sInput) {
    boolean checkedValue = true;
    sInput = sInput.toUpperCase();
    char[] cInput = sInput.toCharArray();

    for (int i = 0; i < sInput.length(); i++) {
        if (cInput[i] != '0' && cInput[i] != '1' && cInput[i] != '2' && cInput[i] != '3' && cInput[i] != '4'
                && cInput[i] != '5' && cInput[i] != '6' && cInput[i] != '7' && cInput[i] != '8'
                && cInput[i] != '9' && cInput[i] != 'A' && cInput[i] != 'B' && cInput[i] != 'C'
                && cInput[i] != 'D' && cInput[i] != 'E' && cInput[i] != 'F') {
            checkedValue = false;//from  www  .  j  a  va 2  s .co  m
        }
    }
    return checkedValue;
}

From source file:com.hpcloud.mon.common.model.alarm.AlarmOperator.java

@JsonCreator
public static AlarmOperator fromJson(String text) {
    return valueOf(text.toUpperCase());
}

From source file:Main.java

private static String singleTagFormat(String originStr, String originTag, String destinTag) {
    originTag = originTag.toUpperCase();
    String originLowTag = originTag.toLowerCase();
    String reg = "((&lt;)|<)\\s*(\\/)?\\s*((" + originTag + ")|(" + originLowTag
            + "))\\s*((\\\\)|(\\/))?\\s*(>|(&gt;))";
    String temp = originStr.replaceAll(reg, destinTag);
    return temp;/*  w w w . ja  v  a 2  s  .co m*/
}

From source file:Main.java

private static String getCaseAwareOperand2(String operand2, boolean isCaseSensitive) {
    if (!isCaseSensitive) {
        return operand2.toUpperCase();
    }/* www.j a  va 2s  .c  om*/
    return operand2;
}

From source file:com.baidu.api.client.version.Version.java

/**
 * Get a version named by the key string.
 *
 * @param key The version name./*from w  w  w  . j a v  a2s  .c o m*/
 * @return The version, null if not found.
 */
public static Version getVersion(String key) {
    return verions.get(key.toUpperCase());
}

From source file:Main.java

public static String checkAndChangeDataHexa(String sInput) {
    String CheckedAndChangedValue = "";
    sInput = sInput.toUpperCase();
    char[] cInput = sInput.toCharArray();

    for (int i = 0; i < sInput.length(); i++) {
        if (cInput[i] == '0' || cInput[i] == '1' || cInput[i] == '2' || cInput[i] == '3' || cInput[i] == '4'
                || cInput[i] == '5' || cInput[i] == '6' || cInput[i] == '7' || cInput[i] == '8'
                || cInput[i] == '9' || cInput[i] == 'A' || cInput[i] == 'B' || cInput[i] == 'C'
                || cInput[i] == 'D' || cInput[i] == 'E' || cInput[i] == 'F') {
            CheckedAndChangedValue += cInput[i];
        }/*from   w w  w . j a va 2 s  .  c  o  m*/
    }
    return CheckedAndChangedValue;
}

From source file:Main.java

public static String unicode2String(String unicodeStr) {
    StringBuffer sb = new StringBuffer();
    String str[] = unicodeStr.toUpperCase().split("U");
    for (int i = 0; i < str.length; i++) {
        if (str[i].equals(""))
            continue;
        char c = (char) Integer.parseInt(str[i].trim(), 16);
        sb.append(c);//from   ww w .j  a  v  a2  s .  c om
    }
    return sb.toString();
}

From source file:monasca.common.model.alarm.AlarmState.java

@JsonCreator
public static AlarmState fromJson(@JsonProperty("state") String text) {
    return AlarmState.valueOf(text.toUpperCase());
}

From source file:Main.java

public static String addressToTTSString(String address) {
    Map<String, String> replaceMap = new HashMap<>();
    replaceMap.put("NE", "Northeast");
    replaceMap.put("NW", "Northwest");
    replaceMap.put("SE", "southeast");
    replaceMap.put("SW", "southwest");
    replaceMap.put("E", "east");
    replaceMap.put("W", "west");
    replaceMap.put("S", "south");
    replaceMap.put("N", "north");
    replaceMap.put("ST", "street");
    replaceMap.put("AVE", "avenue");

    String[] words = address.split(" ");
    StringBuilder returnString = new StringBuilder();
    for (String word : words) {
        if (replaceMap.containsKey(word.toUpperCase())) {
            word = ""; //+ replaceMap.get(word.toUpperCase());
        }/*from w ww.ja  v  a 2s .com*/
        word = word.toLowerCase();
        returnString.append(word).append(" ");
    }
    return returnString.toString();
}