Just as a mention, this was far beyond what was needed in order to achieve this kind of functionality:
Code:
switch (char.Parse(this.upperCase.Text))
{
case 'A':
this.upperCaseDEC.Text = "65";
break;
case 'B':
this.upperCaseDEC.Text = "66";
break;
case 'C':
this.upperCaseDEC.Text = "67";
break;
case 'D':
this.upperCaseDEC.Text = "68";
etc...
You can do conversions directly:
Code:
char c = 'A';
int x = (int)c;
And for the "\" issue, all you needed was to double up on that character to escape itself. There's also the string verbatim. But as soon as you mentioned having this issue with the "\" character, I knew you were doing something perhaps not very efficient in your code... As that wouldn't happen with user input into a textbox for instance.