sharan Kumar

sharan Kumar

  • NA
  • 9
  • 4.5k

increment an alpha-numeric number. in c sharp

Aug 9 2014 4:45 AM
I am trying to increment an alpha-numeric number. The problem is that the final result doesn't appear in label18

this my code

 private void AutoIncrement()
        {
            var str = label18.Text;
            var tempArray = str.Split('/');
            string tempId = tempArray[2];
            int id = Convert.ToInt32(tempId);
            id = id + 1;
            string autoId = "LG/SALES/" + String.Format("{0:0000000}", id);
            label18.Text = autoId;
        }

Answers (1)