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

@SuppressLint("DefaultLocale")
public static String parseByte2HexStr(byte buf[]) {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < buf.length; i++) {
        String hex = Integer.toHexString(buf[i] & 0xFF);
        if (hex.length() == 1) {
            hex = '0' + hex;
        }/*from  www.  ja va  2 s. c  o m*/
        sb.append(hex.toUpperCase());
    }
    return sb.toString();
}

From source file:Main.java

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

From source file:Main.java

public static void printHexString(String hint, byte[] b) {
    System.out.print(hint);/*from   w  w w  . ja v a  2  s. c  o  m*/
    for (int i = 0; i < b.length; i++) {
        String hex = Integer.toHexString(b[i] & 0xFF);
        if (hex.length() == 1) {
            hex = '0' + hex;
        }
        System.out.print(hex.toUpperCase() + " ");
    }
    System.out.println("");
}

From source file:Main.java

public static String byte2hex(byte[] bytes) {
    StringBuilder sign = new StringBuilder();
    for (int i = 0; i < bytes.length; i++) {
        String hex = Integer.toHexString(bytes[i] & 0xFF);
        if (hex.length() == 1) {
            sign.append("0");
        }//from   ww  w  . j a  va 2  s  .  c om
        sign.append(hex.toUpperCase());
    }
    return sign.toString();
}

From source file:Main.java

public static String parseByte2HexStr(byte buf[]) {
    StringBuilder stringBuilder = new StringBuilder();
    for (byte b : buf) {
        String hex = Integer.toHexString(b & 0xFF);
        if (hex.length() == 1) {
            hex = '0' + hex;
        }//from  w  w w  . ja  v a2 s  . co  m
        stringBuilder.append(hex.toUpperCase());
    }
    return stringBuilder.toString();
}

From source file:Main.java

public static void printHexString(String hint, byte[] b) {
    System.out.print(hint);// w  ww . ja va2s  . co  m
    for (int i = 0; i < b.length; i++) {
        String hex = Integer.toHexString(b[i] & 0xFF);
        if (hex.length() == 1) {
            hex = "0" + hex;
        }
        System.out.print(hex.toUpperCase() + " ");
    }
    System.out.println("");
}

From source file:com.folion.social.SignInUtils.java

public static List<GrantedAuthority> createAuthorities(AccountRole securityProfile) {
    List<GrantedAuthority> grantedAuthorities = new ArrayList<GrantedAuthority>(1);
    if (securityProfile != null) {
        String role = "ROLE_" + securityProfile.name();
        GrantedAuthority grantedAuthority = new SimpleGrantedAuthority(role.toUpperCase());
        grantedAuthorities.add(grantedAuthority);
    }// www.  j  a v  a  2 s  .c o  m
    return grantedAuthorities;
}

From source file:br.com.manish.ahy.kernel.util.TextUtil.java

public static String capFirstLetter(String str) {
    String firstLetter = str.substring(0, 1);
    String ret = str.substring(1, str.length());
    ret = firstLetter.toUpperCase() + ret;
    return ret;// w  w w . jav  a  2 s  . c  o m
}

From source file:com.almende.pi5.common.FlexRange.java

/**
 * For value./*from w  w w.  j ava2  s. c o m*/
 *
 * @param value
 *            the value
 * @return the flex range
 */
@JsonCreator
public static FlexRange forValue(final String value) {
    return value == null ? null : valueOf(value.toUpperCase());
}

From source file:Main.java

private static String byteToHexString(byte[] digest) {
    StringBuffer hexString = new StringBuffer();
    for (int i = 0; i < digest.length; i++) {
        String hex = Integer.toHexString(digest[i] & 0xFF);
        if (hex.length() == 1) {
            hex = '0' + hex;
        }// w  ww .  j av a 2  s  .com
        hexString.append(hex.toUpperCase());
    }
    return hexString.toString();
}