Posted By

BenClayton on 03/10/11


Tagged


Versions (?)

Android: String in strings.xml with multiple substitutions


 / Published in: Objective C
 

note the odd %1$s syntax. If you only have one substitution, you could just use %s.

  1. // in strings.xml
  2. <string name="cannot_play_video">The video %1$s cannot be played.\n%2$s</string>
  3.  
  4. // to use..
  5. <context>.getString(R.string.cannot_play_video), url, msg )

Report this snippet  

You need to login to post a comment.