How to turn char a to b in vb.net

Hi, I am trying to increase char in vb.net, for example: Dim letter As char = "a" c. and i want to do it b etc. How can i do this?

+4
source share
1 answer

You can get the ascii code, increment and convert back to Char:

Chr(Asc(letter) + 1) 

Unicode Version:

 ChrW(AscW(letter) + 1) 

EDIT:

As Glen pointed out, you need to be careful if you are trying to increase the "z" c

+7
source

All Articles