Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I use MessageFormat if I need to provide more… How can I use MessageFormat if I need to provide more than 10 parameters?

parameters
0
Posted

How can I use MessageFormat if I need to provide more… How can I use MessageFormat if I need to provide more than 10 parameters?

0

Location: http://www.jguru.com/faq/view.jsp?EID=391639 Created: Mar 31, 2001 Author: Alexander Valdez (http://www.jguru.com/guru/viewbio.jsp?EID=18380) Question originally posed by John Zukowski PREMIUM (http://www.jguru.com/guru/viewbio.jsp?EID=7 The short answer is you can’t. A review of the source for the MessageFormat class shows that it checks (arbitrarily, IMO) that the parameter number is between 0 and 9, throwing a NumberFormatException otherwise. The longer answer that some extra work is required to chop up your source text, use multiple patterns and arrays, and concatenate the resulting parts.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123