定義:<?xml version="1.0" encoding="utf-8"?><resources> <string name="str1">Hello</string> <string name="str2" formatted="false"><![CDATA[值=(B-C)÷((C+D)) ...
定義:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="str1">Hello</string>
<string name="str2" formatted="false"><![CDATA[值=(B-C)÷((C+D))×100%,若<80%則正常,反之則異常。]]></string>
<string name="str3">你好,我是%1$s,今年%2$d歲</string>
</resources>
使用:
String s = this.getResources().getString(R.string.str3);
s = String.format(s, "張三", 80);
Logcat.e("",s);