How do I format my string in GWT?
I made a method
Formatter format = new Formatter();
int matches = 0;
Formatter formattedString = format.forma
I'm not keen on abusing string manipulation for doing regexps' job, but, based on bodrin's solution, you can code:
public static String format (String pattern, final Object ... args) {
for (Object arg : args) {
String part1 = pattern.substring(0,pattern.indexOf('{'));
String part2 = pattern.substring(pattern.indexOf('}') + 1);
pattern = part1 + arg + part2;
}
return pattern;
}