`

MessageFormat

 
阅读更多
MessageFormat用来格式化一个消息,通常是一个字符串,比如:
String str = "I'm not a {0}, age is {1,number,short}", height is {2,number,#.#};

String text="hello {0},hehe{1}";

MessageFormat mf=new MessageFormat(text);

 

String value=MessageFormat.format(new Object[]{"adobe","goole"});

System.out.println(value);


// hello adobe ,hehe google
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics