Your questions are very difficult to decrypt. Looking at your other questions show a similar image.
It would help to get more useful answers if you try to pose the questions more precisely.
E.g. as Sergey already mentioned, a = 1 and b = 2 are not "characters". An you also do not answer to counter questions. Why? This is quite annoying.
Andi

Solution 3

Use int.Parse or int.TryParse, but instead of int use any numeric type you like and then see the description of these two methods in MSDN help. Depending on content of the character data, it succeeds or not. As simple as that.

Solution 2

Create an enumeration for your values then look at this article, Tips about .NET Enums[^], to see how to convert from the string representation (your char) to the corresponding value (integer) and back again.