사용자 도구

사이트 도구


java:string_format

문서의 이전 판입니다!


Java String Format

MessageFormat

 int planet = 7;
 String event = "a disturbance in the Force";
 
 String result = MessageFormat.format(
     "At {1,time} on {1,date}, there was {2} on planet {0,number,integer}.",
     planet, new Date(), event);
 
// 결과
 At 12:30 PM on Jul 3, 2053, there was a disturbance in the Force on planet 7.
java/string_format.1481760919.txt.gz · 마지막으로 수정됨: 2016/12/15 08:45 저자 kwon37xi