Pad Strings from the left in CSharp
Description
The following code shows how to pad Strings from the left.
Example
// w w w . ja va 2 s.co m
using System;
public class PaddingStrings
{
static void Main(string[] args)
{
string MyString = "Hello World java2s.com";
Console.WriteLine(MyString.PadLeft(50));
}
}
The code above generates the following result.