Returns this string right-aligned in a field and padded with spaces.
Returns this string right-aligned in a specified field width and padded with spaces as needed.
[Visual Basic] Overloads Public Function PadRight(Integer) As String
[C#] public string PadRight(int);
[C++] public: String* PadRight(int);
[JScript] public function PadRight(int) : String;
Returns this string right-aligned in a specified field width and padded with a specified character as needed.
[Visual Basic] Overloads Public Function PadRight(Integer, Char) As String
[C#] public string PadRight(int, char);
[C++] public: String* PadRight(int, __wchar_t);
[JScript] public function PadRight(int, Char) : String;
Managed C++
Note This example shows how to use one of the overloaded versions of PadRight. For other examples that may be available, see the individual overload topics.
String *foo = L"forty-two";Console::Write(L"|"); Console::Write(foo->PadRight(25, L'.'));Console::WriteLine(L"|"); Console::Write(L"|");Console::Write(foo->PadRight(5, L'.')); Console::WriteLine(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))