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:com.hangum.tadpole.rdb.core.editors.main.utils.SQLTextUtil.java

/**
 *   ??  ./*w w  w  . j a  va2 s .  c  o m*/
 * 
 * @param strQuery
 * @param intPosition
 * @return
 */
public static String findPrevKeywork(String strQuery, int intPosition) {
    String strBeforeTxt = strQuery.substring(0, intPosition);
    String[] strArryBeforeTxt = StringUtils.split(strBeforeTxt, ' ');

    try {
        for (int i = 1; i <= strArryBeforeTxt.length; i++) {
            String tmp = strArryBeforeTxt[strArryBeforeTxt.length - i];
            //  ? ; ? .
            tmp = removeSpecialChar(tmp);

            if (SQLConstants.listTableKeywords.contains(tmp.toUpperCase())) {
                return tmp.toUpperCase();
            } else if (SQLConstants.listColumnKeywords.contains(tmp.toUpperCase())) {
                return tmp.toUpperCase();
            }
        }
    } catch (Exception e) {
        logger.error("preve keyword", e);
    }

    return "";
}

From source file:com.splicemachine.derby.test.framework.SpliceIndexWatcher.java

public static void executeDrop(Connection connection, String indexSchemaName, String indexName) {
    LOG.trace("executeDrop");
    try (Statement statement = connection.createStatement()) {
        statement.execute(//  w  w w.  j  av a2  s .  c o  m
                String.format("drop index %s.%s", indexSchemaName.toUpperCase(), indexName.toUpperCase()));
    } catch (Exception e) {
        LOG.error("error Dropping " + e.getMessage());
        throw new RuntimeException(e);
    }
}

From source file:net.geoprism.DataUploader.java

private static String convertRomanToArabic(String part) {
    if ("IV".equals(part.toUpperCase())) {
        return part.substring(0, part.length() - 2) + "4";
    }//  ww  w  .jav  a 2 s.  co  m
    if ("V".equals(part.toUpperCase())) {
        return part.substring(0, part.length() - 1) + "5";
    }
    if ("III".equals(part.toUpperCase())) {
        return part.substring(0, part.length() - 3) + "3";
    }
    if ("II".equals(part.toUpperCase())) {
        return part.substring(0, part.length() - 2) + "2";
    }
    if ("I".equals(part.toUpperCase())) {
        return part.substring(0, part.length() - 1) + "1";
    }
    return part;
}

From source file:edu.umd.cs.marmoset.utilities.MarmosetUtilities.java

/**
 * @param param// w w w. j a  va  2  s .  com
 * @return
 */
public static boolean isTrue(String param) {
    param = param.toUpperCase();
    if (param.equals("TRUE") || param.equals("YES"))
        return true;
    return false;
}

From source file:com.glaf.mail.util.MailUtils.java

public static String replaceBase64Decode(String str) {
    if (str.toUpperCase().indexOf("=?GBK?B?") != -1 && str.indexOf("?=") != -1) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < str.length(); i++) {
            if (str.toUpperCase().indexOf("=?GBK?B?") != -1 && str.indexOf("?=") != -1) {
                sb.append(str.substring(0, str.toUpperCase().indexOf("=?GBK?B?")));
                String temp = str.substring(str.toUpperCase().indexOf("=?GBK?B?") + 8, str.indexOf("?="));
                temp = getFromBASE64(temp);
                sb.append(temp);/*from w w w . ja v a 2  s  .c  o m*/
                if (str.indexOf("?=") != -1) {
                    str = str.substring(str.indexOf("?=") + 2, str.length());
                }
            }
        }
        str = sb.toString();
    } else if (str.toUpperCase().indexOf("=?GB2312?B?") != -1 && str.indexOf("?=") != -1) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < str.length(); i++) {
            if (str.toUpperCase().indexOf("=?GB2312?B?") != -1 && str.indexOf("?=") != -1) {
                sb.append(str.substring(0, str.toUpperCase().indexOf("=?GB2312?B?")));
                String temp = str.substring(str.toUpperCase().indexOf("=?GB2312?B?") + 11, str.indexOf("?="));
                temp = getFromBASE64(temp);
                sb.append(temp);
                if (str.indexOf("?=") != -1) {
                    str = str.substring(str.indexOf("?=") + 2, str.length());
                }
            }
        }
        str = sb.toString();
    }
    return str;
}

From source file:Main.java

/**
 * Format a value as int into a hexadecimal string with a length.
 * //from   ww w.j  av  a 2  s  . c  o  m
 * @param value
 *            the value to convert
 * @param len
 *            the length of the string
 * @return
 */
public static String format(int value, int len) {
    String result = Integer.toHexString(value);
    int length = result.length();
    // Test if value is negative => FFFF in front of
    for (int i = 0; i < len - length; i++) {
        result = "0" + result;
    }
    if (len < length) {
        result = result.substring(length - len);
    }
    return result.toUpperCase();
}

From source file:com.cognifide.qa.bb.provider.selenium.webdriver.WebDriverType.java

/**
 * Returns WebDriverType for name//from w w  w  . j  a v  a2s.  c o m
 *
 * @param typeName name of web driver type
 * @return WebDriverType
 */
public static WebDriverType get(String typeName) {
    WebDriverType webDriverType = WebDriverType.HTML;
    if (StringUtils.isNotBlank(typeName)) {
        try {
            webDriverType = WebDriverType.valueOf(typeName.toUpperCase());
        } catch (IllegalArgumentException e) {
            LOG.error("Illegal type: " + typeName, e);
        }
    }
    return webDriverType;
}

From source file:net.fenyo.mail4hotspot.dns.Msg.java

private static byte hex2Byte(final String hex) throws GeneralException {
    if (hex.length() != 2)
        throw new GeneralException("invalid hex size");
    char c0 = hex.toUpperCase().charAt(0);
    char c1 = hex.toUpperCase().charAt(1);
    if (c0 >= 'A')
        c0 = (char) (c0 - 'A' + 10);
    else//from  w  w  w.  ja  v a 2  s.co m
        c0 = (char) (c0 - '0');
    if (c1 >= 'A')
        c1 = (char) (c1 - 'A' + 10);
    else
        c1 = (char) (c1 - '0');
    return (byte) (c0 * 16 + c1);
}

From source file:com.epam.catgenome.util.ProteinSequenceUtils.java

/**
 * Convert nucleotide triplet to amino acids, using RNA codon table.
 *
 * @param triplet nucleotide triplet/*  w  ww  .  ja v a2  s  .c o m*/
 * @return corresponded amino acid
 */
public static String tripletToAminoAcid(final String triplet) {
    validateTriplet(triplet);
    String newTriple = triplet.toUpperCase().replace("T", "U");
    for (RnaCodonTable aminoAcid : RnaCodonTable.values()) {
        if (aminoAcid.correspondedTriples.contains(newTriple)) {
            return aminoAcid.title;
        }
    }

    throw new IllegalArgumentException("Triplet " + triplet + " can not be converted to amino acid. ");
}

From source file:jef.tools.string.RegexpUtils.java

/**
 * ?pattern/*  w  w w  .  j av a2 s.c  o m*/
 * @param key
 * @param IgnoreCase
 * @param matchStart
 * @param matchEnd
 * @param wildcardSpace
 * @return
 */
public static Pattern simplePattern(String key, boolean IgnoreCase, boolean matchStart, boolean matchEnd,
        boolean wildcardSpace) {
    if (IgnoreCase) {
        key = key.toUpperCase();
    }
    // ??
    String regStr = simpleMatchToRegexp(key);
    regStr = ((matchStart) ? "" : RegexpUtils.MATCH_ANY_STRING)
            + ((wildcardSpace) ? key.replace(" ", "\\s+") : regStr)
            + ((matchEnd) ? "" : RegexpUtils.MATCH_ANY_STRING);
    Pattern p = Pattern.compile(regStr);
    return p;
}