摘要: JDK1.5中,String类新增了一个很有用的静态方法String.format(): format(Locale l, String format, Object... args) 使用指定的语言环境、格式字符串和参数返回一个格式化字符串。 format(String format, Object... args) 使用指定的格式字符串和参数返回一个格式化字符串。 举几个这个方法实用的例子(注释是输出结果): CODE: long now = System.currentTimeMillis(); String s = String.format("%tR", now) 阅读全文
posted @ 2014-03-17 10:50 峰与若及 阅读(3187) 评论(0) 推荐(0)