65.9K
CodeProject is changing. Read more.
Home

Alphanumeric increment in C#

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.33/5 (16 votes)

Oct 12, 2004

viewsIcon

85500

downloadIcon

4823

This code is very useful when you want to auto increment number using A-Z and 1-9 with possible combinationYou can pass any string and system will return next possible number e.g. You can Pass number "PRO01A9" then You will get "PRO01B1"

 Download source files - 439 Kb

Introduction

This code is useful when you want to generate number which can be auto-Alphanumeric increment  like product code or Item code this will generate next possible number using A-Z and 0-9 number.

one good thing with this is you can always keep width of Number fix all the time system will always return number in same with as u passed one.

So this solution will be application for following business requirements.

  • When You want to generate Item code or product code with fix width
  • Auto Increment based on last number so you don't have to manage any system this code will return same.