title: Java string format condition
body: <p>I want to write a sentence that is dependent on person's gender, here is what i could do:</p>
  
  <pre><code>String createSentence(String name, boolean isMale) {
      return String.format(isMale ? "I met %s, he was OK." : "I met %s, she was OK.", name);
  }
  </code></pre>
  
  <p>but you already see the fail in that (it works, but code is duplicit), i want something like:</p>
  
  <pre><code>String createSentence(String name, boolean isMale) {
      return String.format("I met %s, %b?'he':'she' was OK.", name, isMale);
  }
  </code></pre>
  
  <p>This ofc doesn't work, but is something like this possible?</p>
  
  <p>EDIT:</p>
  
  <p>Since I will want many sentences to be generated, even in different languages, and they will be stored is some sort or array, thus this solution is unhandy:</p>
  
  <pre><code>static String createSentence(String name, boolean isMale) {
      return String.format("I met %s, "+(isMale?"he":"she")+" was OK.", name);
  }
  </code></pre>