title: Format a message using MessageFormat.format() in Java
body: <p>I have stored some messages in a resource bundle. I'm trying to format these messages as follows.</p>
  
  <pre><code>import java.text.MessageFormat;
  
  String text = MessageFormat.format("You're about to delete {0} rows.", 5);
  System.out.println(text);
  </code></pre>
  
  <p>Assume that the first parameter i.e the actual message is stored in a property file which is somehow retrieved.</p>
  
  <p>The second parameter i.e 5 is a dynamic value and should be placed in the placeholder <code>{0}</code> which doesn't happen. The next line prints,</p>
  
  <blockquote>
    <p>Youre about to delete {0} rows.</p>
  </blockquote>
  
  <p>The placeholder is not replaced with the actual parameter.</p>
  
  <hr>
  
  <p>It is the apostrophe here - <code>You're</code>. I have tried to escape it as usual like <code>You\\'re</code> though it didn't work. What changes are needed to make it work? </p>