0

I am trying to use the code after searching too much in google for alphabet increment. My logic is;

string result = char.ConvertFromUtf32(97 + index1 % 26) + result

The code is working fine till A to Z. However, i want the next letter to appear after Z as AA in one click. Then AB till ZZZZZ.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364

1 Answers1

0

You should just have a number and increment it normally but then convert it to base 26, it will naturally give the increments from A thru to ZZZZ.

Have a look at this other answer here for a C# solution that allows base 10 to base 26 conversion.

Community
  • 1
  • 1
Rus
  • 1,827
  • 1
  • 21
  • 32