Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 a 的文本设置为TextView“(+teamName)分数:”
TextView
我目前拥有的: textview1.setText(+teamName "Score:"); 包含一个错误,因为标准格式应该是("" + teamName)
textview1.setText(+teamName "Score:");
("" + teamName)
我如何让它显示TextViewTHEN 引号?这甚至可能吗?
(注意:teamName指向一个字符串)
teamName
这是可能的。+在需要的地方使用字符串变量 ( teamName) 和"Score: "
+
"Score: "
textview1.setText(teamName + " Score:");
String text = String.format("%s Score", teamName); textview1.setText(text);