/**
* java.text.MessageFormat 拼接string
* 如果存在引号包含的占位值,单引号用''{x}'',双引号用''''{x}''''
* */
public static String formatStr() {
String policySql = "delete from t_table_{0} where trans_no=''{1}'' and name in ({2});";
String result = MessageFormat.format(policySql, "10", "20181210", "dage");
return result;
}
记录下来,这个是java的标准类库,后续其他方式更新上去。
为什么使用标准,根据effective java的说明: