I got it working for what I want it to do, but I cant help feel there is an easier way to do this.


byte[] gen = new byte[5];
char[] holder = setpointBoxQS.Text.ToCharArray();
string[] conv = new string[holder.Length];
int[] iconv = new int[holder.Length];

for (int i = 0; i < holder.Length; i++)
{
conv[i] = holder[i].ToString();
}

if (holder.Length > 2)
{
for (int i = 0; i < holder.Length; i++)
{
iconv[i] = Convert.ToInt32(conv[i]);
gen[i] = (byte)iconv[i];
}
}