C# 數字轉字串補0 & 字串補0
C# 數字轉字串補0 & 字串補0
01.數字轉字串補0:
this.f1_textBox2.Text = String.Format("{0:0000000000000000}",(Convert.ToInt16(this.f1_textBox2.Text) + 1));
02.字串補0:
string str = "9"; str.PadLeft(4, '0');//-->0009 str.PadRight(4, '0');//-->9000