| Author |
Problem while displaying ' using MessageFormat
|
An Sush
Ranch Hand
Joined: Jan 17, 2007
Posts: 47
|
|
Test.java: Prop.properties It outputs : So as seen the ' is missing and it doesnt substitue the parameter values also. It seems that by having '' (2quotes) in properties file: Prop.properties the outputr comes as intended: Can anyoone tell me whats wrong with the original code? any better workaround? I have modified as follows but not sure if thats the correct way to handle ' coming via properties file: Modified Test.java
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12911
|
|
There is nothing wrong; this is just how MessageFormat works. The single quote has a special meaning in the strings you pass to MessageFormat; it can be used for quoting other special characters, so you can include those characters literally in the format pattern. See the API documentation of class MessageFormat for a detailed explanation. [ March 20, 2008: Message edited by: Jesper Young ]
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: Problem while displaying ' using MessageFormat
|
|
|