Java随笔 对于{0}-{1}这种类型的字符串的处理 代码示例结果示例 代码示例 String text="{0}-{1}"; MessageFormat mf=new MessageFormat(text); String value=mf.format(new Object[]{"Hello","World"}); System.out.println(value); 结果示例