我希望将字符串中的数字对齐,如下: 3 x 89 kg 3 x 133 kg 我使用这种格式:String.format("%1$3d x %2$3d kg", nb, weight); 但是结果不正确:
"%3d x %3d kg"
也可以工作。 - Andreas