1
Answer

increment an alpha-numeric number. in c sharp

sharan Kumar

sharan Kumar

10y
788
1
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)