Ascii Value from a variable (Configurator UDM)

Inputs.txt_XVar_5_Description.Value = strChar;
int intAsc =(int)‘A’;
//The above line works just fine and returns the value. I need to be able to get an alpha or numeric value.
//How can I substitute a variable (IE: strChar)for the ‘A’? I need the equivalent of a variant type? Driving me goo gootz. Many thanks in advance.

if ((intAsc > 47 && intAsc < 58)==true)
{
Inputs.chr_X6.Value = “YES”;
}
else
{
Inputs.chr_X6.Value = “NO”;
}

Have you tried using string.Compare function? C# String Compare and CompareTo - Dot Net Perls

Another way I have done something like you are attempting is to use the “contains” function.
String MyChar =“G”
Inputs.chr_X6.Value = (“ABCDEFGHIJKL”.Contains(MyChar) ? “Yes” :”No”;

Above line should result in “Yes”. If MyChar =“M” it would yield “No”