How do I format my string in GWT?
I made a method
Formatter format = new Formatter();
int matches = 0;
Formatter formattedString = format.forma
Or even simpler, not using RegExp, and using only Strings:
public static String format(final String format, final String... args) {
String[] split = format.split("%s");
final StringBuffer msg = new StringBuffer();
for (int pos = 0; pos < split.length - 1; pos += 1) {
msg.append(split[pos]);
msg.append(args[pos]);
}
msg.append(split[split.length - 1]);
return msg.toString();
}