The actual problem is the number 15001 order 15001-a automatically generated 15001-b,15001-c ....
//Description: Generate 15001-b with 15001-a as a benchmarkstringMaxno ="15001-a";//1. Separate the order number and suffixstring[] Strmax = Maxno. Split ('-');//split the string with '-' to separate 150001 and a//2. Convert ASCII code values to a char character string, convertCharSort = (Char) strmax[1][0];//strmax[1] Array 2nd element, Strmax[1][0] The first character of the 2nd element of an array//3. Convert to ASCII-corresponding numbers intASCII = (int) sort;//convert letter A to ASCII value//4. Serial number +1 intASCII2 = ASCII +1;//serial number plus 1, for the//5. Convert Back to letterstringSort2 = ((Char) (ASCII2). ToString ();//and convert to letter B .//6. Return the stitched string 15001-breturnstrmax[0] +"-"+ Sort2. ToString ();
Alphabetical sequence increment, i.e. A+1=b,b+2=d