Android strings.xml 使用

设置字符串格式

1
<string name="welcome_messages">Hi, %1$s! You have %2$d new messages.</string>  
1
var text = getString(R.string.welcome_messages, "kalaqiae", 10)  

输出:Hi, kalaqiae! You have 10 new messages.

%d (表示整数)
%f (表示浮点数)
%s (表示字符串)