I have the following code:
string s = \"2563MNBJP89256666666685755854\"; Byte[] bytes = encoding.GetBytes(s); string hex = \"\";
For C# you could try
C#
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding(); Byte[] bytes = encoding.GetBytes(strVar);//strVar is the string variable