Format a string resource
suggest changeYou can add wildcards in string resources and populate them at runtime:
- Edit strings.xml
<string name="my_string">This is %1$s</string>
- Format string as needed
String fun = "fun";
context.getString(R.string.my_string, fun);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents