转自 :http://zqc-0101.iteye.com/blog/1140140 MessageFormat用来格式化一个消息,通常是一个字符串,比如: String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#}; 而MessageFormat可以格式化这样的消息,然后将格式化后的字符串插入到模式中的适当位置,比如: 将str中的{0}用"pig"替换,{1,nu…
MessageFormat用来格式化一个消息,通常是一个字符串,比如: String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#}; 而MessageFormat可以格式化这样的消息,然后将格式化后的字符串插入到模式中的适当位置,比如: 将str中的{0}用"pig"替换,{1,number,short}用数字8替换,{2,number,#.#}用数字1.2替换. 那…
MessageFormat用来格式化一个消息,通常是一个字符串,比如: String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#}; 而MessageFormat可以格式化这样的消息,然后将格式化后的字符串插入到模式中的适当位置,比如: 将str中的{0}用"pig"替换,{1,number,short}用数字8替换,{2,number,#.#}用数字1.2替换. 那…