I have the following code:
string s = \"2563MNBJP89256666666685755854\";
Byte[] bytes = encoding.GetBytes(s);
string hex = \"\";
Isn't bytes
already the list of bytes you want?
For C#
you could try
System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
Byte[] bytes = encoding.GetBytes(strVar);//strVar is the string variable
C#: System.Text.Encoding.ASCII.GetBytes("test")
in C# you can use Encoding.GetBytes Method