PadLeft()函数:向左补齐
PadRight()函数:向右补齐
class Program
{
static void Main(string[] args)
{
int a = ;
Console.WriteLine(a.ToString().PadLeft(,'')); //向左补齐
Console.WriteLine(a.ToString().PadRight(, '')); //向右补齐
Console.ReadKey();
}
}
2022-05-23 23:53:51
PadLeft()函数:向左补齐
PadRight()函数:向右补齐
class Program
{
static void Main(string[] args)
{
int a = ;
Console.WriteLine(a.ToString().PadLeft(,'')); //向左补齐
Console.WriteLine(a.ToString().PadRight(, '')); //向右补齐
Console.ReadKey();
}
}