Convert string[] array to byte[] array RRS feed

  • Question

  • Hi All,

    could any one please help me out the following,

    I am trying to convert the following string [] to byte[],

    string[] arr = new string[]{"A","B","C"};

    How to convert the above string array arr to byte array.

    i have tried the following way but i am not succeed in that,

    byte[] bytArr = new byte[arr.Length];

    int i = 0;

    foreach (string text in arr)
    bytArr[i++] = Byte.Parse(source[i].ToString());
    return Move(bytArr,size,false);

    its giving the exception -  "input string was not in a correct format".

    Thanks in advance.

    Tuesday, June 24, 2014 11:58 AM