【发布时间】:2009-12-16 14:42:44
【问题描述】:
StringBuilder sb = new StringBuilder();
// Send all output to the Appendable object sb
Formatter formatter = new Formatter(sb, Locale.US);
// Explicit argument indices may be used to re-order output.
formatter.format("%4$2s %3$2s %2$2s %1$2s", "a", "b", "c", "d")
// -> " d c b a"
在这种情况下,为什么要在 $ 后面加上 2?
【问题讨论】: