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:org.eclipse.swt.snippets.Snippet287.java

public static boolean find(TreeItem item, String searchString) {
    /* check this item */
    for (int i = 0; i < tree.getColumnCount(); i++) {
        String contents = item.getText(i);
        if ((contents.toUpperCase().indexOf(searchString.toUpperCase())) != -1) {
            tree.setSelection(item);/*  w  w w  . j ava2s. c o  m*/
            return true;
        }
    }

    if (!item.getExpanded())
        return false; /* don't check child items */

    /* check child items */
    int childCount = item.getItemCount();
    for (int i = 0; i < childCount; i++) {
        TreeItem child = item.getItem(i);
        boolean success = find(child, searchString);
        if (success)
            return true;
    }

    return false;
}

From source file:org.mayocat.model.AddonFieldType.java

@JsonCreator
public static AddonFieldType fromJson(String text) {
    if (text == null) {
        return null;
    }//from  ww w . jav  a  2  s . c o  m
    return valueOf(text.toUpperCase());
}

From source file:Main.java

public static boolean contains(String instr, String part) {
    if (instr == null || part == null) {
        return false;
    }/*  w  ww .ja v  a  2 s  .  c  o m*/
    return instr.toUpperCase().contains(part.toUpperCase());
}

From source file:com.bazaarvoice.lassie.screenboard.widgets.Visualization.java

/**
 * The name of the expected enum as it is documented in the datadog API.
 *
 * @param name The name of the expected enum.
 * @return The Visualization enum.//ww w.  j  a  va2s .c  o m
 */
@JsonCreator
public static Visualization fromName(String name) {
    checkNotNull(name);
    return Visualization.valueOf(name.toUpperCase());
}

From source file:com.netflix.spinnaker.fiat.model.resources.ResourceType.java

public static ResourceType parse(@NonNull String pluralOrKey) {
    if (pluralOrKey.contains(":")) {
        pluralOrKey = StringUtils.substringAfterLast(pluralOrKey, ":");
    }//from   w  w  w  . j  a  va2  s. c o m
    String singular = StringUtils.removeEnd(pluralOrKey, "s");
    return ResourceType.valueOf(singular.toUpperCase());
}

From source file:Main.java

/**
 * Converts the given xpath express to uppercase tags. All tags in IE are
 * returned as upper case and if the xpath isn't converted, no tags will match
 * the xpath./*from  w  w w  .j  a  va2s  .  co m*/
 */
protected static String convertXPath(String xpath) {
    Matcher matcher = p.matcher(xpath);
    StringBuffer buffer = new StringBuffer();
    while (matcher.find()) {
        String group = matcher.group();
        if (group.matches("\\/[\\w]*")) {
            buffer.append(group.toUpperCase());
        } else {
            buffer.append(group);
        }
    }
    return buffer.toString();
}

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

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

From source file:Main.java

private static String pairTagFormat(String originStr, String originTag, String destinStartTag,
        String destinEndTag) {/*w w  w  . j a  v  a 2  s . c om*/
    originTag = originTag.toUpperCase();
    String originLowTag = originTag.toLowerCase();
    String reg = "((&lt;)|<)\\s*((" + originTag + ")|(" + originLowTag + "))\\s*(>|(&gt;))";
    String temp = originStr.replaceAll(reg, destinStartTag);
    reg = "((&lt;)|<)\\s*(\\/)\\s*((" + originTag + ")|(" + originLowTag + "))\\s*(>|(&gt;))";
    temp = temp.replaceAll(reg, destinEndTag);
    return temp;
}

From source file:Main.java

public static byte[] ConvertStringToHexBytes(String StringToConvert) {
    StringToConvert = StringToConvert.toUpperCase();
    StringToConvert = StringToConvert.replaceAll(" ", "");
    char[] CharArray = StringToConvert.toCharArray();
    char[] Char = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
    int result = 0;
    byte[] ConvertedString = new byte[] { (byte) 0x00, (byte) 0x00 };
    for (int i = 0; i <= 1; i++) {

        for (int j = 0; j <= 15; j++) {
            if (CharArray[i] == Char[j]) {
                if (i == 1) {
                    result = result + j;
                    j = 15;//w w w. j  a  va  2  s.  com
                }

                else if (i == 0) {
                    result = result + j * 16;
                    j = 15;
                }

            }
        }
    }
    ConvertedString[0] = (byte) result;

    result = 0;
    for (int i = 2; i <= 3; i++) {
        for (int j = 0; j <= 15; j++) {
            if (CharArray[i] == Char[j]) {
                if (i == 3) {
                    result = result + j;
                    j = 15;
                }

                else if (i == 2) {
                    result = result + j * 16;
                    j = 15;
                }

            }
        }
    }
    ConvertedString[1] = (byte) result;

    return ConvertedString;
}

From source file:architecture.ee.web.community.social.provider.ServiceProviderHelper.java

public static Media toMedia(String name) {
    return Media.valueOf(name.toUpperCase());
}