来自Java世界,我很放心在文档中看到编号参数有格式化支持,所以如果我有以下字符串格式:
String(format:"%1$s drew from the %3$s pile and discarded the %4$s", name, pickedUp, pile, discard)
我希望:
Droid drew from the Draw pile and discarded the KS
(忽略第二个参数,即拾取卡)
但我真正得到的是:
Droid drew from the 5C and discarded the Draw
好像完全忽略了编号参数。我做错了什么?