|
-
April 12th, 2011, 11:51 AM
#2
Re: String[] to Byte[] index by index please
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];
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|