-2
Sentences : 
Test Your Skills 1, ... 2, ... 3, ....
Specify Your Skills 1, ..2, ...3, ....
Check Your Skills 1, ..2, ...3, ....

..

restofsentence="Your Skills"+ ? ;
String test = "Test" + restofsentence
String specify = "Specify" + restofsentence
String check = "Check" + restofsentence

如何定义 restofsentence 变量“?” 必须定义任何数字

'test = "Test Your Skills 6" ', 'test = "Test Your Skills 36" ' 都必须在不使用循环的情况下配对,因为我们不知道最后一个数字

4

1 回答 1

1

您可以使用该String.format()方法。

String format = "%1$s your skill %2$d";
String test = String.format(format, "Test", 4);
于 2013-05-14T16:41:44.533 回答