METHOD
String.PadLeft
Returns text padded at the beginning to at least width UTF-16 code units. Does not truncate longer input or guarantee visual column alignment.
Formal Syntax & Structure
csharp syntaxcsharp
text.PadLeft(width, paddingChar)Working Example
Example Snippetcsharp
using System;Console.WriteLine("7".PadLeft(3, '0')); // 007