Returns this string left-aligned in a field.
Returns this string left-aligned in a field of specified width.
[Visual Basic] Overloads Public Function PadLeft(Integer) As String
[C#] public string PadLeft(int);
[C++] public: String* PadLeft(int);
[JScript] public function PadLeft(int) : String;
Returns this string left-aligned in a field and padded with the specified padding character as needed.
[Visual Basic] Overloads Public Function PadLeft(Integer, Char) As String
[C#] public string PadLeft(int, char);
[C++] public: String* PadLeft(int, __wchar_t);
[JScript] public function PadLeft(int, Char) : String;
Managed C++:
Note This example shows how to use one of the overloaded versions of PadLeft. For other examples that may be available, see the individual overload topics.
String *foo = L"forty-two"; Console::WriteLine(foo->PadLeft(15, L'.')); Console::WriteLine(foo->PadLeft(2, L'.')); Visual Basic: Dim foo As String Dim bar As Char foo = "forty-two" bar = Convert.ToChar(".") 'Must do Char assignment in this round-about way for now since 'assignment of a character literal to a Char (e.g. bar = "."C) 'has not yet been implemented in VB. Console.WriteLine(foo.PadLeft(15, bar)) Console.WriteLine(foo.PadLeft(2, bar))