Generating sequential alphanumeric numbers on ASP.net C# -


i want generate following sequence of alphanumeric string in asp.net c#.

aa000 aa001 ... aa999 ab000 ab001 ... az999 ba000 ba001 ... zz999 "

something (linq):

var source = enumerable                .range(0, 1000 * 26 * 26)                .select(x => ((char) ((x / 1000) / 26 + 'a')).tostring() +                             ((char) ((x / 1000) % 26 + 'a')).tostring() +                              (x % 1000).tostring("000")); 

...

foreach(string item in source) { ... }  

to see whole sequence (e.g. debugging etc):

// aa000 aa001 aa002 ... aa999 ab000 ... az999 ba000 ... zz999 mytextbox.text = string.join(" ", source); 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -