Formatted date
// formatted date Public Static void Main (string[] args) { new Date ()); System.out.println (s); }
Formatted date 2
// formatted date 2 Public Static void Main (string[] args) { new Date ()); System.out.println (s); }
Formatted Date 3
// formatted date 3 Public Static void Main (string[] args) { new Date ()); System.out.println (s); }
Placeholder%1 $ s
Public Static void Main (string[] args) { = String.Format ("This is%2$s, that bit is%1 $ s", "xiaoming", "Xiao Huang"); System.out.println (s); }
Formatting numbers
// Formatting numbers Public Static void Main (string[] args) { //%[argument_index$][flags][width][.precision]conversion //%[argument_index$]:%1$ //flag:, the amount is separated by thousands of bits // Conversion:d represents the decimal display of String s = String.Format ("%1$,d", 12302562); System.out.println (s); }
The format method of string--application