@Test public void testMiddle() { Assert.assertEquals("1foo2", Interpolate.string("1{}2", "foo")); }
public static String string(String message, Object... args) { for (Object arg : args) { int i = message.indexOf("{}"); if (i != -1) { message = message.substring(0, i) + String.valueOf(arg) + message.substring(i + 2); } } return message; }
Interpolate { public static String string(String message, Object... args) { for (Object arg : args) { int i = message.indexOf("{}"); if (i != -1) { message = message.substring(0, i) + String.valueOf(arg) + message.substring(i + 2); } } return message; } }
Interpolate { public static String string(String message, Object... args) { for (Object arg : args) { int i = message.indexOf("{}"); if (i != -1) { message = message.substring(0, i) + String.valueOf(arg) + message.substring(i + 2); } } return message; }  }
Interpolate { public static String string(String message, Object... args) { for (Object arg : args) { int i = message.indexOf("{}"); if (i != -1) { message = message.substring(0, i) + String.valueOf(arg) + message.substring(i + 2); } } return message; }  static String string(String message, Object... args); static String string(String message, ConverterRegistry registry, Object... args); }
Interpolate { public static String string(String message, Object... args) { for (Object arg : args) { int i = message.indexOf("{}"); if (i != -1) { message = message.substring(0, i) + String.valueOf(arg) + message.substring(i + 2); } } return message; }  static String string(String message, Object... args); static String string(String message, ConverterRegistry registry, Object... args);  }