MessageFormat provides means to produce concatenated messages
in language-neutral way. Use this to construct messages displayed for end
users. MessageFormat formats message with variable number of
parameters. Pattern string contains placeholders of the form {0} .. {nn}.
Placeholders are replaced by parameters. Escaped "{{" can be used to get '{'
in formatted message.
MessageFormat takes a set of strings, and inserts the them into
the pattern at the appropriate places.
String output = MessageFormat.format("Message {1} for formatting {2}",
new String[]{"first_arg",
"second_arg"});
|