2017-07-12 3 views

答えて

1

System.Stringは、メソッドがPadLeft呼ばれている - それはあなたが選ぶどんな長さにそれを作るために、文字列の左側に好きな文字追加します。

Dim str As String 
Dim pad As Char 
str = "123" 
pad = "."c ' Using dots instead of spaces so you can see it... 
Console.WriteLine(str) 
Console.WriteLine(str.PadLeft(6, pad)) 

結果:

123 
...123 

You can see a live demo on rextester.

参考図:PadRight ...

関連する問題