0

In my ASP.Net web page, I want to change the active index numerical values to text values.

For instance, the active index currently renders numerically as 1, 2, 3, 4, etc... I would like to have this index render as a, b, c, d, etc...

Could you please suggest a way to do so?

Steve Guidi
  • 19,700
  • 9
  • 74
  • 90
SmartestVEGA
  • 8,415
  • 26
  • 86
  • 139

3 Answers3

1

write simple mapping function which returns corresponding alphabet.

TheVillageIdiot
  • 40,053
  • 20
  • 133
  • 188
1

The answers to this question will help. Basically you can just cast your int to a char if you want a really rudimentary solution.

Community
  • 1
  • 1
Paul Suart
  • 6,505
  • 7
  • 44
  • 65
1

You can convert them easily using:

char c = (char)(96 + index);

It will return a when index is 1, b when 2 and so on...

You will have to write additional code if you want aa for index value of 27.

Yogesh
  • 14,498
  • 6
  • 44
  • 69