java練習筆記
String Format延伸應用:
String Format延伸應用:
- fix position : left justified()
System.out.println(String.format("%-10s hello" , s1));
hello java
hello java
- fix position : right justified()
hello java
- fill zero in front
String.format("%03d" , s1)
050
050
留言
張貼留言