未知的字符/单词

时间:2013-05-14 16:36:57

标签: java android

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 =“测试你的技能6”','test =“测试你的技能36”'所有必须在不使用循环的情况下配对,因为我们不知道最后的数字

1 个答案:

答案 0 :(得分:1)

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

String format = "%1$s your skill %2$d";
String test = String.format(format, "Test", 4);
相关问题