得到字符串类型
@param str
@return
@see Chars#char2StringType(CharType)
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;		
	}
1159600
public JBBPTextWriter Str(final String... str) throws IOException {
    JBBPUtils.assertNotNull(str, "String must not be null");

    final String oldPrefix = this.prefixValue;
    final String oldPostfix = this.postfixValue;
    this.prefixValue = "";
    this.postfixValue = "";

    for (final String s : str) {
      ensureValueMode();
      printValueString(s == null ? "<NULL>" : s);
    }

    this.prefixValue = oldPrefix;
    this.postfixValue = oldPostfix;
    return this;
  }
514744
public static String fwsTohws( String str )
    {
        char[] chars = str.toCharArray();
        for ( int j = 0; j < chars.length; j++ ) {
            if ( chars[j] == '\u3000' ) {
                chars[j] = '\u0020';
            } else if ( chars[j] > '\uFF00' 
                && chars[j] < '\uFF5F' ) {
                chars[j] = (char)(chars[j] - 65248);
            }       
        }
        
        return new String(chars);
    }
1324526
function(str){
            str = (str || "").toString();
            str = str.replace(/\=(?:\r?\n|$)/g, "");
            var str2 = "";
            for(var i=0, len = str.length; i<len; i++){
                chr = str.charAt(i);
                if(chr == "=" && (hex = str.substr(i+1, 2)) && /[\da-fA-F]{2}/.test(hex)){
                    str2 += String.fromCharCode(parseInt(hex,16));
                    i+=2;
                    continue;
                }
                str2 += chr;
            }
            return str2;
        }
517243
public static boolean checkNameing(String str)
	{
		char[] commonArray = new char[str.length()];
		int len = 0;
		if (str == null || (len = str.length()) == 0)
		{
			return false;
		}
		str.getChars(0, len, commonArray, 0);
		int index = 0;
		char word = commonArray[index++];
		//首字母判断  不为数字 , .
		if (word >= 46 && word <= 57)
			setLog(1, word);
		//尾字母判断
		else if (commonArray[len - 1] == 46)
			setLog(len, 46);
		else
			while (true)
			{
				if (word < 36 || word > 122 || chars[word - 36] == 0)
				{
					setLog(index + 1, word);
					return false;
				}
				if (index == len)
					return true;
				word = commonArray[index++];
			}
		return false;
	}
1023923
public static int charType(String str)
    {
        if (str != null && str.length() > 0)
        {
            if (Predefine.CHINESE_NUMBERS.contains(str)) return CT_CNUM;
            byte[] b;
            try
            {
                b = str.getBytes("GBK");
            }
            catch (UnsupportedEncodingException e)
            {
                b = str.getBytes();
                e.printStackTrace();
            }
            byte b1 = b[0];
            byte b2 = b.length > 1 ? b[1] : 0;
            int ub1 = getUnsigned(b1);
            int ub2 = getUnsigned(b2);
            if (ub1 < 128)
            {
                if (ub1 < 32) return CT_DELIMITER; // NON PRINTABLE CHARACTERS
                if (' ' == b1) return CT_OTHER;
                if ('\n' == b1) return CT_DELIMITER;
                if ("*\"!,.?()[]{}+=/\\;:|".indexOf((char) b1) != -1)
                    return CT_DELIMITER;
                if ("0123456789".indexOf((char)b1) != -1)
                    return CT_NUM;
                return CT_SINGLE;
            }
            else if (ub1 == 162)
                return CT_INDEX;
            else if (ub1 == 163 && ub2 > 175 && ub2 < 186)
                return CT_NUM;
            else if (ub1 == 163
                    && (ub2 >= 193 && ub2 <= 218 || ub2 >= 225
                    && ub2 <= 250))
                return CT_LETTER;
            else if (ub1 == 161 || ub1 == 163)
                return CT_DELIMITER;
            else if (ub1 >= 176 && ub1 <= 247)
                return CT_CHINESE;

        }
        return CT_OTHER;
    }
1225384
public String toSimp(String str) {   
		char[] c = str.toCharArray();
		for (int i = 0; i < str.length(); i++) {   
			char cc = l2s.get(c[i]);
			if (cc != 0) {   
				c[i] = cc;   
			} 
		}   
		return new String(c);   
	}
652176
public static Map<String, String> parseQString(String str) {

		Map<String, String> map = new HashMap<String, String>();
		int len = str.length();
		StringBuilder temp = new StringBuilder();
		char curChar;
		String key = null;
		boolean isKey = true;
		boolean isOpen = false;//值里有嵌套
		char openName = 0;
		if(len>0){
			for (int i = 0; i < len; i++) {// 遍历整个带解析的字符串
				curChar = str.charAt(i);// 取当前字符
				if (isKey) {// 如果当前生成的是key
					
					if (curChar == '=') {// 如果读取到=分隔符 
						key = temp.toString();
						temp.setLength(0);
						isKey = false;
					} else {
						temp.append(curChar);
					}
				} else  {// 如果当前生成的是value
					if(isOpen){
						if(curChar == openName){
							isOpen = false;
						}
						
					}else{//如果没开启嵌套
						if(curChar == '{'){//如果碰到，就开启嵌套
							isOpen = true;
							openName ='}';
						}
						if(curChar == '['){
							isOpen = true;
							openName =']';
						}
					}
					
					if (curChar == '&' && !isOpen) {// 如果读取到&分割符,同时这个分割符不是值域，这时将map里添加
						putKeyValueToMap(temp, isKey, key, map);
						temp.setLength(0);
						isKey = true;
					} else {
						temp.append(curChar);
					}
				}
				
			}
			putKeyValueToMap(temp, isKey, key, map);
		}
		return map;
	}
514407
public static boolean isJsonArray(String str) {
		if (StrUtil.isBlank(str)) {
			return false;
		}
		return StrUtil.isWrap(str.trim(), '[', ']');
	}
467688
public static StringType char2StringType(CharType c) {
		switch(c){
		case D: return StringType.D;
		case C: return StringType.C;
		case L: return StringType.L;
		case B: return StringType.B;
		default: return StringType.O;
		}
	}
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;
            }
        }
    }
1280723
public static String TraToSimplified( String str )
    {
        StringBuffer sb = new StringBuffer();
        int idx;
        for ( int j = 0; j < str.length(); j++ ) {
            if ( (idx = TRASTR.indexOf(str.charAt(j))) != -1 ) {
                sb.append(SIMSTR.charAt(idx));
            } else {
                sb.append(str.charAt(j));
            }
        }
        return sb.toString();
    }
916887
public static boolean findChinese(String str) {
        Matcher m = pattern.matcher(str);
        return m.find();
    }
156447
public static String pad(String str, int totalChars) {
    if (str == null) {
      str = "null";
    }
    int slen = str.length();
    StringBuilder sb = new StringBuilder(str);
    for (int i = 0; i < totalChars - slen; i++) {
      sb.append(' ');
    }
    return sb.toString();
  }
831123
public int chn2Num(String str,Loc loc){
		int tempNum;
		int num=0,init=loc.v,init2=loc.v;
		int flag=63;//"111111"亿万千百十
		int len=str.length();
		int chr;
		while(init<len){
			//十的情况比较特殊，故单独判断。如十三  不必如二十三一般有前置数字；
			if((flag&2)>0 && str.charAt(init)=='十'){//flag>0即允许出现十的状态
				flag&=63-14;//出现十之后下个单位不可能是千百十
				tempNum=10;
				init++;
			}
			else{			
				//不接受数字则结束
				if((flag&1)==0){
					loc.v=init;
					break;
				}
				flag-=1;//置末位0
				//判断数字
				tempNum=chn2Num(str.charAt(init));
				if(tempNum<0){
					loc.v=init;
					break;//不能识别，结束
				}
				init++;
				if(tempNum==0){
					flag|=1;
					continue;
				}
				//判断单位字符是否存在
				if(init>=len){
					loc.v=init;
					num+=tempNum;
					break;
				}
				chr=str.charAt(init);
				//判断十
				if((flag&2)>0 && chr=='十'){
					flag&=63-14;//出现十之后下个单位不可能是千百十
					flag|=1;//可以接受个位
					tempNum*=10;
					init++;
				}
				//判断百
				else if((flag&4)>0 && chr=='百'){
					flag&=63-12;//出现百之后下个单位不可能是千百
					flag|=1;//可以接受个位
					tempNum*=100;
					init++;
				}
				//判断千
				else if((flag&8)>0 && chr=='千'){
					flag&=63-8;//出现百之后下个单位不可能是千
					flag|=1;//可以接受个位
					tempNum*=1000;
					init++;
				}
			}

			num+=tempNum;
			//判断单位字符是否存在 并识别万
			if(init<len){
				chr=str.charAt(init);
				if((flag&16)>0 && chr=='万'){
					flag=15;//万之后不再出现万，也不会有亿
					num*=10000;
					init++;
					loc.v=init;
					int numNext=this.chn2Num(str, loc);
					if(numNext>0)
						num+=numNext;
					break;
				}
				else if((flag&32)>0 && chr=='亿'){
					flag=31;//亿之后不再出现亿
					num*=100000000;
					init++;
					loc.v=init;
					int numNext=this.chn2Num(str, loc);
					if(numNext>0)
						num+=numNext;
					break;
				}
			}
			continue;
		}
		if(init2!=init)
			return num;
		
		else 
			return -1;
	}
798422
public static byte []
fromString(String str) {
	ByteArrayOutputStream bs = new ByteArrayOutputStream();
	byte [] raw = str.getBytes();
	for (int i = 0; i < raw.length; i++) {
		if (!Character.isWhitespace((char)raw[i]))
			bs.write(raw[i]);
	}
	byte [] in = bs.toByteArray();
	if (in.length % 2 != 0) {
		return null;
	}

	bs.reset();
	DataOutputStream ds = new DataOutputStream(bs);

	for (int i = 0; i < in.length; i += 2) {
		byte high = (byte) Base16.indexOf(Character.toUpperCase((char)in[i]));
		byte low = (byte) Base16.indexOf(Character.toUpperCase((char)in[i+1]));
		try {
			ds.writeByte((high << 4) + low);
		}
		catch (IOException e) {
		}
	}
	return bs.toByteArray();
}
1054188
function CharToString(val) {
    if (val < 0x10000) {
        return String.fromCharCode(val);
    }
    else {
        val -= 0x10000;
        return String.fromCharCode(0xD800 + (val >> 10), 0xDC00 + (val & 0x3FF));
    }
}