字符串中只有数字。如果只含有数字，则返回true，反之，返回false.
@param str 待检测字符串
@return 是否只含有数字（0-9）
329135
public static boolean hasOnlyNum(String str) {

        if (isEmpty(str))
            return false;

        Pattern pattern = Pattern.compile("[0-9]*");
        return pattern.matcher(str).matches();
    }
994121
public static boolean isNumeric(String str, int beginIndex, int endIndex)
    {
        for ( int i = beginIndex; i < endIndex; i++ ) {
            char chr = str.charAt(i);
            if ( ! StringUtil.isEnNumeric(chr) ) {
                return false;
            }
        }

        return true;
    }
435504
public int indexOf(String str) {
        int i;

        for (i = 0; i < size; i++) {
            if (data[i].equals(str)) {
                return i;
            }
        }
        return -1;
    }
137999
public static boolean isAllAlpha(String str) {

	if (str == null) return false;

	for (int i = str.length() - 1; i >= 0; i--) {

	    if (!Character.isLetter(str.charAt(i))) return false;
	}

	return true;
    }
1209791
protected int _countPeriods(String str)
    {
        int commas = 0;
        for (int i = 0, end = str.length(); i < end; ++i) {
            int ch = str.charAt(i);
            if (ch < '0' || ch > '9') {
                if (ch == '.') {
                    ++commas;
                } else {
                    return -1;
                }
            }
        }
        return commas;
    }
697491
public static boolean allDigits(String string) {
        if (string == null || string.length() == 0) {
            return false;
        }
        for (int index = 0; index < string.length(); index++) {
            char ch = string.charAt(index);
            if (ch < '0' || ch > '9') {
                return false;
            }
        }
        return true;
    }
981343
public static boolean isInteger(CharSequence str, int off, int len) {
        if (len == 0) return false;
        int i = off;
        if (str.charAt(i) == '-') {
            if (len == 1) return false;
            ++i;
        }
        for (; i < len; ++i) {
            char c = str.charAt(i);
            if (c < '0' || c > '9') return false;
        }
        return true;
    }
1362472
public static int safeStrToInt(String str) {
        if (sciInt.matcher(str).find()) {
            return SafeCast.safeDoubleToInt(Double.parseDouble(str.toUpperCase()));
        } else {
            return Integer.parseInt(str);
        }
    }
962596
public static StringType getStringType(String str) {
		TreeSet<CharType> set = getTypeSet(str);
		if(set.size()==1){
			CharType c = set.first();
			return char2StringType(c);
		}
		return StringType.M;		
	}
1260400
public static List<String> split(String str, int limit){
		if(StrUtil.isEmpty(str)){
			return new ArrayList<String>(0);
		}
		if(limit == 1){
			return addToList(new ArrayList<String>(1), str, true, true);
		}
		
		final ArrayList<String> list = new ArrayList<>();
		int len = str.length();
		int start = 0;//切分后每个部分的起始
		for(int i = 0; i < len; i++){
			if(CharUtil.isBlankChar(str.charAt(i))){
				addToList(list, str.substring(start, i), true, true);
				start = i+1;//i+1同时将start与i保持一致
				
				//检查是否超出范围（最大允许limit-1个，剩下一个留给末尾字符串）
				if(limit > 0 && list.size() > limit-2){
					break;
				}
			}
		}
		return addToList(list, str.substring(start, len), true, true);//收尾
	}
1287832
public static boolean isLetterOrNumeric(String str, int beginIndex, int endIndex)
    {
        for ( int i = beginIndex; i < endIndex; i++ ) {
            char chr = str.charAt(i);
            if ( ! StringUtil.isEnLetter(chr)
                    && ! StringUtil.isEnNumeric(chr) ) {
                return false;
            }
        }

        return true;
    }
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;
    }
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
1093460
public static int cint(String str)
    {
        if (str != null)
            try
            {
                int i = new Integer(str).intValue();
                return i;
            }
            catch (NumberFormatException e)
            {

            }

        return -1;
    }
1122575
public static boolean isNumber(String str) {
		if (StrUtil.isBlank(str)) {
			return false;
		}
		char[] chars = str.toCharArray();
		int sz = chars.length;
		boolean hasExp = false;
		boolean hasDecPoint = false;
		boolean allowSigns = false;
		boolean foundDigit = false;
		// deal with any possible sign up front
		int start = (chars[0] == '-') ? 1 : 0;
		if (sz > start + 1) {
			if (chars[start] == '0' && chars[start + 1] == 'x') {
				int i = start + 2;
				if (i == sz) {
					return false; // str == "0x"
				}
				// checking hex (it can't be anything else)
				for (; i < chars.length; i++) {
					if ((chars[i] < '0' || chars[i] > '9') && (chars[i] < 'a' || chars[i] > 'f') && (chars[i] < 'A' || chars[i] > 'F')) {
						return false;
					}
				}
				return true;
			}
		}
		sz--; // don't want to loop to the last char, check it afterwords
				// for type qualifiers
		int i = start;
		// loop to the next to last char or to the last char if we need another digit to
		// make a valid number (e.g. chars[0..5] = "1234E")
		while (i < sz || (i < sz + 1 && allowSigns && !foundDigit)) {
			if (chars[i] >= '0' && chars[i] <= '9') {
				foundDigit = true;
				allowSigns = false;

			} else if (chars[i] == '.') {
				if (hasDecPoint || hasExp) {
					// two decimal points or dec in exponent
					return false;
				}
				hasDecPoint = true;
			} else if (chars[i] == 'e' || chars[i] == 'E') {
				// we've already taken care of hex.
				if (hasExp) {
					// two E's
					return false;
				}
				if (!foundDigit) {
					return false;
				}
				hasExp = true;
				allowSigns = true;
			} else if (chars[i] == '+' || chars[i] == '-') {
				if (!allowSigns) {
					return false;
				}
				allowSigns = false;
				foundDigit = false; // we need a digit after the E
			} else {
				return false;
			}
			i++;
		}
		if (i < chars.length) {
			if (chars[i] >= '0' && chars[i] <= '9') {
				// no type qualifier, OK
				return true;
			}
			if (chars[i] == 'e' || chars[i] == 'E') {
				// can't have an E at the last byte
				return false;
			}
			if (chars[i] == '.') {
				if (hasDecPoint || hasExp) {
					// two decimal points or dec in exponent
					return false;
				}
				// single trailing decimal point after non-exponent is ok
				return foundDigit;
			}
			if (!allowSigns && (chars[i] == 'd' || chars[i] == 'D' || chars[i] == 'f' || chars[i] == 'F')) {
				return foundDigit;
			}
			if (chars[i] == 'l' || chars[i] == 'L') {
				// not allowing L with an exponent
				return foundDigit && !hasExp;
			}
			// last character is illegal
			return false;
		}
		// allowSigns is true iff the val ends in 'E'
		// found digit it to make sure weird stuff like '.' and '1E-' doesn't pass
		return !allowSigns && foundDigit;
	}
370524
@Override
	public int lookupIndex(String str) {
		int ret = data.get(str);
		if (ret ==-1 && !frozen)	{
			ret = index.size();
			data.put(str, ret);
			index.put(ret, str);
		}
		return ret;
	}
699007
public int chn2Num(String str){
		Loc loc=new Loc();
		loc.v=0;
		int w=chn2Num(str,loc);
		if(loc.v==str.length())
			return w;
		else return -1;
	}