Public class StringFormat {
Public static void main (String [] args ){
Method ("aa", 124 );
}
Public static void method (String a, int B ){
// Result:/inner/payment/aa/courier/124
String s = String. format ("/inner/payment/% s/courier/% d", a, B );
System. out. println (s );
}
}
Date date = new Date (); // 2014-11-07
// Output the date represented by two digits, which is less than 07
System. out. println (String. format ("% td", date ));
// Output the date represented by two digits. Do not fill in 7
System. out. println (String. format ("% te", date ));
// Returns the month in double digits. If the digit is not enough, auto-fill is set to 11.
System. out. println (String. format ("% tm", date ));
// Output year 14 with two digits
System. out. println (String. format ("% ty", date ));
// Output the year 2014 of the four digits
System. out. println (String. format ("% tY", date ));
// Output the day of the year (001-366) 311
System. out. println (String. format ("% tj", date ));
// Output the week (Friday) of the specified language environment
System. out. println (String. format ("% ta", date ));
// Output the full name of the week for the specified language environment, Friday
System. out. println (String. format ("% tA", date ));
// Output the month of the specified language environment (January 1, November)
System. out. println (String. format ("% tb", date ));
// Output the full name of the month in the specified language environment, January 1, November
System. out. println (String. format ("% tB", date ));
// Output all date and time information of the specified language environment on the day of the week, September 07 14:17:51 CST 2014
System. out. println (String. format ("% tc", date ));
String. format