JAVA中String {0}占位符的使用 使用方法 public static void main(String[] args) { String text = "那就这样{0},或许本该如此{1}"; // java.text.MessageFormat; text = MessageFormat.format(text, "吧", "!"); System.out.println(text); }