Java字符串格式化输入({0}/%s)

用法:

System.out.println(MessageFormat.format("{0}{1}",1,2));
System.out.println(String.format("%s-%s","adsfadf",123));

 

参考:

https://www.cnblogs.com/fsjohnhuang/p/4094777.html

http://www.blogjava.net/longturi/archive/2013/09/17/404166.html

 

posted @ 2018-01-24 02:11  EasonJim  阅读(7374)  评论(0编辑  收藏  举报