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 String algorismToHEXString(int algorism) {
    String result = "";
    result = Integer.toHexString(algorism);

    if (result.length() % 2 == 1) {
        result = "0" + result;

    }//from w w w  .java  2 s. c om
    result = result.toUpperCase();

    return result;
}

From source file:kirchnerei.glatteis.page.ui.NotifyKind.java

public static NotifyKind fromString(String kind) {
    if (StringUtils.isEmpty(kind)) {
        return INFO;
    }//from   ww w.  j a v a  2s .  c  o m
    try {
        return valueOf(kind.toUpperCase());
    } catch (Exception e) {
        return INFO;
    }
}

From source file:jp.toastkid.script.models.Language.java

/**
 * ??????.//from   w  ww. j ava 2 s  .c  om
 * @param lang 
 * @return ?
 */
public static String extension(final String lang) {
    if (StringUtils.isBlank(lang)) {
        return ".groovy";
    }
    return extension(Language.valueOf(lang.toUpperCase()));
}

From source file:Main.java

/**
 * Convert a string to properly formatted title case
 * @param A string//from w  w  w .ja v  a2 s  .c o m
 * @return String, properly formatted in title case.
 */
public static String titleCase(String string) {

    String result = "";
    String[] words = string.split(" ");

    for (int i = 0; i < words.length; i++) {
        String word = words[i];
        String wordResult = "";
        for (int j = 0; j < word.length(); j++) {
            String next = word.substring(j, j + 1);
            if (j == 0) {
                wordResult += next.toUpperCase();
            } else {
                wordResult += next.toLowerCase();
            }
        }

        if (i < words.length) {
            result += " " + wordResult;
        } else {
            result += wordResult;
        }

    }

    return result;

}

From source file:it.unibz.instasearch.indexing.querying.ModifiedTimeConverter.java

private static Interval getIntervalByName(String intervalName) {
    try {/*from w w w.j av  a  2s  . c  om*/
        return Interval.valueOf(intervalName.toUpperCase());
    } catch (Throwable ignored) {
        return null;
    }
}

From source file:Main.java

public static String byteToMac(byte[] resBytes) {
    StringBuffer buffer = new StringBuffer();
    for (int i = 0; i < resBytes.length; i++) {
        String hex = Integer.toHexString(resBytes[i] & 0xFF);
        if (hex.length() == 1) {
            hex = '0' + hex;
        }/*w  w w .  ja v  a  2s . com*/
        buffer.append(hex.toUpperCase());
    }
    return buffer.toString();
}

From source file:org.jenkinsci.plugins.fabric8.support.RestClient.java

public static HttpHost getHost(TaskListener listener, String name, String protocol)
        throws UnknownHostException {
    String envPrefix = name.toUpperCase().replace('-', '_');
    String envHost = envPrefix + "_SERVICE_HOST";
    String envPort = envPrefix + "_SERVICE_PORT";
    String host = System.getenv(envHost);
    String portText = System.getenv(envPort);
    if (host == null || portText == null) {
        log(listener, "No service " + name + "  is running!!!");
        return null;
    }//from w w  w.ja  v a2  s .c  o m
    int portNumber = Integer.parseInt(portText);
    return new HttpHost(host, portNumber, protocol);
}

From source file:Main.java

public static @Nullable String getSimCountryIso(Context context) {
    String simCountryIso = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE))
            .getSimCountryIso();//from   ww w  .j a v  a 2 s. c  o  m
    return simCountryIso != null ? simCountryIso.toUpperCase() : null;
}

From source file:Main.java

public static String bytesToHexString(byte[] bytes) {
    String result = "";
    for (int i = 0; i < bytes.length; i++) {
        String hexString = Integer.toHexString(bytes[i] & 0xFF);
        if (hexString.length() == 1) {
            hexString = '0' + hexString;
        }//www.  j  ava 2 s  .c o  m
        result += hexString.toUpperCase();
    }
    return result;
}

From source file:ch.aonyx.broker.ib.api.data.bar.RealTimeBarDataType.java

public static final RealTimeBarDataType fromLabel(final String label) {
    if (StringUtils.isBlank(label)) {
        return EMPTY;
    }/*from ww  w.j a va  2s. co  m*/
    final String labelUpperCase = label.toUpperCase();
    if (MAP.containsKey(labelUpperCase)) {
        return MAP.get(labelUpperCase);
    }
    return UNKNOWN;
}