标签:函数 code console adk bsp col rgs nbsp str
PadLeft()函数:向左补齐
PadRight()函数:向右补齐
class Program { static void Main(string[] args) { int a = 3; Console.WriteLine(a.ToString().PadLeft(3,‘0‘)); //向左补齐 Console.WriteLine(a.ToString().PadRight(3, ‘0‘)); //向右补齐 Console.ReadKey(); } }
标签:函数 code console adk bsp col rgs nbsp str
原文地址:https://www.cnblogs.com/cnwuchao/p/10586721.html