Format string to a 3 digit number

前端 未结 9 1339
说谎
说谎 2020-12-15 02:07

Instead of doing this, I want to make use of string.format() to accomplish the same result:

if (myString.Length < 3)
{
    myString =  \"00\"         


        
9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 02:46

    "How to: Pad a Number with Leading Zeros" http://msdn.microsoft.com/en-us/library/dd260048.aspx

提交回复
热议问题