補滿

  • 1722
  • 0
  • 2009-06-24

摘要:補滿

string MaxID = Convert.ToString(MF.MaxID() + 1);
            MaxID = "A" + MaxID.PadLeft(5, '0');//補滿0

//outPut:A00001

string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime("2009/1/1" ));//日期補0

//outPut:2009/01/01