Zi 字媒體
2017-07-25T20:27:27+00:00
C# 數字轉字串補0 & 字串補0
數字轉字串補0:
this.f1_textBox2.Text = String.Format(“{0:0000000000000000}”, (Convert.ToInt16(this.f1_textBox2.Text) + 1));
字串補0:
string str = “9”;
str.PadLeft(4, ‘0’);//–>0009
str.PadRight(4, ‘0’);//–>9000
寫了
5860316篇文章,獲得
23313次喜歡