构建字符串
"1 {} 2 {} " TO "1 %s 2 %s"
@param format 格式化
@param params 参数列表
@return 构建的结果
966661
private String buildString(String format, Object[] params) {
        String stringFormat = format;
        for(int i = 0; i < params.length; i++) {
            stringFormat = stringFormat.replaceFirst("\\{}", "%s");
        }
        return String.format(stringFormat, params);
    }
1174176
function (format) {
            _validFormat(format);
    
            var m = _regexDecFormat.exec(format);
            if (m !== null)
                return (  (typeof m[3] === 'string') ? m[3].length : 0 )
                     + ( (m[4] === '%')              ? 2           : 0 );
            
            else {
                m = _regexFracFormat.exec(format);
                if (m !== null)
                    return _getPrecision(1 / parseInt(m[2], 10));
            }
            
            throw "IllegalArgumentException: format is not recognized (" + format + ")";
        }
600903
public void infov(String format, Object... params) {
        doLog(Level.INFO, FQCN, format, params, null);
    }
1110153
public static String formatDate(java.util.Date pDate, String format) {

        if (pDate == null) {
            pDate = new java.util.Date();
        }
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(pDate);
    }
529789
static public String normalize(byte[] data, int format) {

        if (null == data) {
            return null;
        }
        if (0 == data.length) {
            return "";
        }
        // if normalization is off, just return
        if (NORMALIZE_OFF == format) {
            return new String(data);
        }

        char[] buf = new char[data.length];
        for (int index = 0; index < data.length; index++) {
            buf[index] = normalize((char) data[index], format);
        }

        return new String(buf, 0, buf.length);
    }
1009533
public static String format(Date date, String format) {
		if (null == date || StrUtil.isBlank(format)) {
			return null;
		}
		return format(date, FastDateFormat.getInstance(format));
	}
960118
public static String date2Str(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
631034
public static String generateStringExample(String format, List<String> enumValues) {
        if (enumValues == null || enumValues.isEmpty()) {
            if (format == null) {
                return "string";
            } else {
                switch (format) {
                    case "byte":
                        return "Ynl0ZQ==";
                    case "date":
                        return "1970-01-01";
                    case "date-time":
                        return "1970-01-01T00:00:00Z";
                    case "email":
                        return "email@example.com";
                    case "password":
                        return "secret";
                    case "uuid":
                        return "f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
                    default:
                        return "string";
                }
            }
        } else {
            return enumValues.get(0);
        }
    }
826092
public Optional<ConversionConfig> getConversionConfigForFormat(String format) {
    return Optional.fromNullable(this.destConversionConfigs.get(format));
  }
729292
public LambdaDslJsonArray timestamp(final String format, final Instant example) {
        pactArray.timestamp(format, example);
        return this;
    }
927841
public static int getFormatDepth(SampleFormat format) {
		switch (format) {
			case U8:
			case U8P:
				return 1;
			case S16:
			case S16P:
				return 2;
			case S32:
			case S32P:
				return 4;
			case FLT:
			case FLTP:
				return 4;
			case DBL:
			case DBLP:
				return 8;

			default:
				return 0;
		}
	}
925352
function formatParams_(params) {
  var query = '';
  if (params) {
    params.f = params.f || 'json';
    for (var x in params) {
      if (params.hasOwnProperty(x) && params[x] !== null && params[x] !== undefined) { // wont sent undefined.
        //jslint complaint about escape cause NN does not support it.
        var val = formatRequestString_(params[x]); 
        query += (query.length > 0?'&':'')+(x + '=' + (escape ? escape(val) : encodeURIComponent(val)));
      }
    }
  }
  return query;
}
287640
public static String toJavaDatePattern(String format) {

        int          len = format.length();
        char         ch;
        StringBuffer sb        = new StringBuffer(len);
        Tokenizer    tokenizer = new Tokenizer();

        for (int i = 0; i <= len; i++) {
            ch = (i == len) ? e
                            : format.charAt(i);

            if (!tokenizer.next(ch, dateTokens)) {
                int index = tokenizer.getLastMatch();

                if (index >= 0) {
                    sb.setLength(sb.length() - tokenizer.length());
                    sb.append(javaDateTokens[index]);
                }

                tokenizer.reset();

                if (tokenizer.isConsumed()) {
                    continue;
                }
            }

            sb.append(ch);
        }

        sb.setLength(sb.length() - 1);

        String javaPattern = sb.toString();

        return javaPattern;
    }
411855
public static String convert(String date, String format, String newFormat) {
        return getFormatDate(newFormat, parse(date, format));
    }
947445
public void errorf(String format, Object... params) {
        doLogf(Level.ERROR, FQCN, format, params, null);
    }
451898
public static String convert2String(long time, String format) {
        if (time > 0l) {
            if (StringUtil.isEmpty(format))
                format = dateTimeFormat;
            SimpleDateFormat sf = new SimpleDateFormat(format);
            Date date = new Date(time);
            return sf.format(date);
        }
        return "";
    }
504821
public static String format(double amount, boolean isUseTraditional, boolean isMoneyMode) {
		final String[] numArray = isUseTraditional ? traditionalDigits : simpleDigits;

		if (amount > 99999999999999.99 || amount < -99999999999999.99) {
			throw new IllegalArgumentException("Number support only: (-99999999999999.99 ～ 99999999999999.99)！");
		}

		boolean negative = false;
		if (amount < 0) {
			negative = true;
			amount = - amount;
		}

		long temp = Math.round(amount * 100);
		int numFen = (int) (temp % 10);
		temp = temp / 10;
		int numJiao = (int) (temp % 10);
		temp = temp / 10;

		//将数字以万为单位分为多份
		int[] parts = new int[20];
		int numParts = 0;
		for (int i = 0; temp != 0; i++) {
			int part = (int) (temp % 10000);
			parts[i] = part;
			numParts++;
			temp = temp / 10000;
		}

		boolean beforeWanIsZero = true; // 标志“万”下面一级是不是 0

		String chineseStr = StrUtil.EMPTY;
		for (int i = 0; i < numParts; i++) {
			String partChinese = toChinese(parts[i], isUseTraditional);
			if (i % 2 == 0) {
				beforeWanIsZero = StrUtil.isEmpty(partChinese);
			}

			if (i != 0) {
				if (i % 2 == 0) {
					chineseStr = "亿" + chineseStr;
				} else {
					if ("".equals(partChinese) && false == beforeWanIsZero) {
						// 如果“万”对应的 part 为 0，而“万”下面一级不为 0，则不加“万”，而加“零”
						chineseStr = "零" + chineseStr;
					} else {
						if (parts[i - 1] < 1000 && parts[i - 1] > 0) {
							// 如果"万"的部分不为 0, 而"万"前面的部分小于 1000 大于 0， 则万后面应该跟“零”
							chineseStr = "零" + chineseStr;
						}
						chineseStr = "万" + chineseStr;
					}
				}
			}
			chineseStr = partChinese + chineseStr;
		}

		// 整数部分为 0, 则表达为"零"
		if (StrUtil.EMPTY.equals(chineseStr)) {
			chineseStr = numArray[0];
		}
		//负数
		if (negative) { // 整数部分不为 0
			chineseStr = "负" + chineseStr;
		}

		// 小数部分
		if (numFen != 0 || numJiao != 0) {
			if (numFen == 0) {
				chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "");
			} else { // “分”数不为 0
				if (numJiao == 0) {
					chineseStr += (isMoneyMode ? "元零" : "点零") + numArray[numFen] + (isMoneyMode ? "分" : "");
				} else {
					chineseStr += (isMoneyMode ? "元" : "点") + numArray[numJiao] + (isMoneyMode ? "角" : "") + numArray[numFen] + (isMoneyMode ? "分" : "");
				}
			}
		}else if(isMoneyMode) {
			//无小数部分的金额结尾
			chineseStr += "元整";
		}

		return chineseStr;

	}