I have stored some messages in a resource bundle. I\'m trying to format these messages as follows.
import java.text.MessageFormat; String text = MessageForm
Here is a method that does not require editing the code and works regardless of the number of characters.
String text = java.text.MessageFormat.format( "You're about to delete {0} rows.".replaceAll("'", "''"), 5);