[C#] C#格式化输出内容 →→→→→进入此内容的聊天室

来自 , 2021-01-05, 写在 C#, 查看 144 次.
URL http://www.code666.cn/view/c0fda89e
  1. nt k = 16;
  2. Console.WriteLine(" '{0,-8}'",k);     // produces:  '16      '
  3. Console.WriteLine(" '{0,8}'",k);      // produces:   '      16'
  4. Console.WriteLine(" '{0,8}'","Test"); // produces:  '    Test'
  5. Console.WriteLine(" '{0,-8}'","Test");// produces: 'Test    '
  6. Console.WriteLine(" '{0:X}'",k);      //(in HEX) produces: '10'
  7. Console.WriteLine(" '{0:X10}'",k);    //(in HEX) produces:'0000000010'
  8. Console.WriteLine( 1234567.ToString("#,##0")); // writes with commas:   1,234,567
  9. //csharp/4818

回复 "C#格式化输出内容"

这儿你可以回复上面这条便签

captcha