Dim myInt as Int32 = 9 Dim myString as String = myInt.ToString("D2") // 09 myString = String.Format("{0:000}", myInt) // 009下面的寫法無效:
Dim myInt as Int32 = 9 Dim myString as String = myInt.ToString() myString = myString.ToString("D2") // 編譯錯誤 myString = String.Format("{0:00}", myString) // 9