title: Format an array of strings with arguments
body: <p>I'd like to format an array of strings just like <a href="http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling" rel="noreferrer">android used to format strings</a>:</p>
  
  <p>Usually we do:</p>
  
  <ul>
  <li><p>strings.xml</p>
  
  <pre><code>&lt;string name="welcome_messages"&gt;Hello, %1$s! You have %2$d new messages.&lt;/string&gt;
  </code></pre></li>
  <li><p>In some java code:</p>
  
  <pre><code>Resources res = getResources();
  String text = String.format(res.getString(R.string.welcome_messages), username, mailCount);
  </code></pre></li>
  </ul>
  
  <p>I'm looking for something like:</p>
  
  <ul>
  <li><p>in some arbitrary xml:</p>
  
  <pre><code>    &lt;string-array name="employee"&gt;
          &lt;item&gt;name: %1$s&lt;/item&gt;
          &lt;item&gt;post: %2$s&lt;/item&gt;
      &lt;/string-array&gt;
  </code></pre></li>
  <li><p>in some java code:</p>
  
  <pre><code>Resources res = getResources();
  String[] employee = ArrayString.format(res.getStringArray(R.string.employee), name, post);
  </code></pre></li>
  </ul>
  
  <p>Is there an elegant way to do that?</p>
  
  <p>EDIT:</p>
  
  <p>The next pieces of code is a workaround and I'm posting it just to help @Sufian, who asked for it in a comment. It's not a real answer once my question is about format the string array's content and the bellow code is formatting each string separately.</p>
  
  <p>In some misc.xml:</p>
  
  <pre><code>&lt;string-array
      name="string_array"&gt;
      &lt;item&gt;1st position: %1$d&lt;/item&gt;
      &lt;item&gt;2nd position: %1$d&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <p>Then, in java code:</p>
  
  <pre><code>res = getResources();
  String[] sa = res.getStringArray(R.array.string_array);
  for (int i = 0; i &lt; sa.length; i++ ) {
      text += String.format(sa[i], i);
  }
  </code></pre>