Converts a string to a leet level.

@param str The string to parse the leet level from.
@return The leet level if valid.
@throws Exception upon invalid level.
492520
public static LeetLevel fromString(String str)
            throws Exception {
        if (str == null || str.equalsIgnoreCase("null") || str.length() == 0)
            return LEVEL1;

        try {
            int i = Integer.parseInt(str);
            if (i >= 1 && i <= LEVELS.length)
                return LEVELS[i - 1];
        } catch (Exception ignored) {}

        String exceptionStr = String.format("Invalid LeetLevel '%1s', valid values are '1' to '9'", str);
        throw new Exception(exceptionStr);
    }
973248
public static UUID attemptUUIDParse(BufferedString str) {
    Long lo = attemptUUIDParseLow(str);
    Long hi = attemptUUIDParseHigh(str);
    return (str.getOffset() == -1) ? null : buildUUID(lo, hi);
  }
246900
public Object fromString(String str)
    {
        if (StringUtils.isNotBlank(str)) {
            ObjectMapper objectMapper = new ObjectMapper();

            try {
                return objectMapper.readValue(str, Object.class);
            } catch (Exception e) {
                LOGGER.info("Failed to parse JSON [{}]: ", StringUtils.abbreviate(str, 32),
                    ExceptionUtils.getRootCauseMessage(e));

                return null;
            }
        }

        return null;
    }
88193
@Nullable
    public static String nullableString(@Nullable String str) {
        return str == null || str.isEmpty() ? null : str;
    }
935887
private static Long attemptUUIDParseLow(BufferedString str) {
    final byte[] buf = str.getBuffer();
    int i=str.getOffset();
    if( i+36 > buf.length ) return markBad(str);
    long lo=0;
    lo = get2(lo,buf,(i+=2)-2);
    lo = get2(lo,buf,(i+=2)-2);
    lo = get2(lo,buf,(i+=2)-2);
    lo = get2(lo,buf,(i+=2)-2);
    if( buf[i++]!='-' ) return markBad(str);
    lo = get2(lo,buf,(i+=2)-2);
    lo = get2(lo,buf,(i+=2)-2);
    if( buf[i++]!='-' ) return markBad(str);
    lo = get2(lo,buf,(i+=2)-2);
    return attemptUUIDParseEnd(str, lo, buf, i);
  }
1119528
private static String exceptionToString(TryTree tree, VisitorState state) {
    if (tree.getCatches().size() != 1) {
      return "Exception";
    }
    Tree exceptionType = tree.getCatches().iterator().next().getParameter().getType();
    Type type = ASTHelpers.getType(exceptionType);
    if (type != null && type.isUnion()) {
      return "Exception";
    }
    return state.getSourceForNode(exceptionType);
  }
111925
protected String getValue(String str) {
        int index = str.indexOf('=');
        String value = null;
        if (index > 0) {
            value = str.substring(index + 1).trim();
            if (value.charAt(0) == '\"') {
                value = value.substring(1, value.length() - 1);
            }
        }
        return value;
    }
899097
public static boolean in( char c, String str ) {
        return Chr.in ( c, FastStringUtils.toCharArray(str) );
    }
1370682
public static boolean isEmpty(final String str) {
        if(str == null || str.isEmpty()) {
            return true;
        }
        
        if(str.length() == 1) {
            return str.charAt(0) == '\u0000';
        }
        
        return false;
    }
335374
public static boolean hasText(@Nullable CharSequence str) {
        if (isEmpty(str)) {
            return false;
        }

        int strLen = str.length();
        for (int i = 0; i < strLen; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                return true;
            }
        }
        return false;
    }
921866
public String toTrad(String str) {   
		char[] c = str.toCharArray();
		for (int i = 0; i < str.length(); i++) {   
			char cc = s2l.get(c[i]);
			if (cc != 0) {   
				c[i] = cc;   
			} 
		}   
		return new String(c);   
	}
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
883878
private static String intPart(String str) {
        return str.indexOf(JAVA_DECIMAL_POINT) > 0 ? str.substring(0,
                str.indexOf(JAVA_DECIMAL_POINT)) : str;
    }
210964
public static StrMatcher stringMatcher(final String str) {
        if (StringUtils.isEmpty(str)) {
            return NONE_MATCHER;
        }
        return new StringMatcher(str);
    }
3841
public static int indexOfIgnoreCase(final String str, final String searchStr) {// NOSONAR
		if (searchStr.isEmpty() || str.isEmpty()) {
			return str.indexOf(searchStr);
		}
		for (int i = 0; i < str.length(); ++i) {
			if (i + searchStr.length() > str.length()) {
				return -1;
			}
			int j = 0;
			int ii = i;
			while (ii < str.length() && j < searchStr.length()) {
				char c = Character.toLowerCase(str.charAt(ii));
				char c2 = Character.toLowerCase(searchStr.charAt(j));
				if (c != c2) {
					break;
				}
				j++;
				ii++;
			}
			if (j == searchStr.length()) {
				return i;
			}
		}
		return -1;
	}
1002911
private static Object typeCast(String str) {
        if (str == null || str.equals("")) {
            return null;
        }
        // Try to cast to boolean true
        for (String trueString : trueArray) {
            if (trueString.equals(str)) {
                return true;
            }
        }
        // Try to cast to boolean false
        for (String falseString : falseArray) {
            if (falseString.equals(str)) {
                return false;
            }
        }
        // Strings that cannot cast to int or double are treated as string
        try {
            return Integer.parseInt(str);
        } catch (Exception e1) {
            try {
                return Double.parseDouble(str);
            } catch (Exception e2) {
                return str;
            }
        }
    }
1220021
public static Point2 parse(String str) {
    String[] numbers = str.split(",");
    if (numbers.length != 2) {
      throw new IllegalArgumentException("'str' has an invalid format.");
    }
    int[] vs = new int[2];
    for (int i = 0; i < numbers.length; i++) {
      String number = numbers[i];
      int left =
          StringUtils.indexOfAny(number, new char[] {'+', '-', '0', '1', '2', '3', '4', '5', '6',
              '7', '8', '9'});
      int right =
          StringUtils.lastIndexOfAny(numbers[i], new char[] {'0', '1', '2', '3', '4', '5', '6',
            '7', '8', '9'});
      if (!(0 <= left && left <= right)) {
        throw new IllegalArgumentException("'str' has an invalid format.");
      }
      vs[i] = Integer.parseInt(numbers[i].substring(left, right + 1));
    }
    return new Point2(vs[0], vs[1]);
  }