none
CSharp Transpose One Dimensional Array RRS feed

  • Question

  • Dear All,

    I am looking and trying One Dimensional Array but so far I managed to find and tested only two dimensional one.

    Let say A  = [1

                        2

                       .

                       .

                       ] display in debug window.

    I wish to see A = [1 2 3 . . ] in debug window.

    I hope some one will advise me to get it done.

    Thanks and best regards

                       

    Friday, February 22, 2013 8:02 AM

Answers

  • Hi,

    Thank you for yuor prompt advice and actually, below is the best for me.

    byte[] data;
    string tmpStr = Encoding.UTF8.GetString(data, 0, data.Length);

    Best regards

    • Marked as answer by Mr Ko Ko Friday, February 22, 2013 9:42 AM
    Friday, February 22, 2013 9:42 AM

All replies

  • Is this what you are after?

    static void Main(string[] args)
    {
        int[] A = new int[5] {1,2,3,4,5};
        string output = "A = [ ";
        foreach (int i in A)
        {
            output += i.ToString() + " ";
        }
        output += "]";
        Console.WriteLine(output);
        Console.ReadLine();
    }

    • Marked as answer by Mr Ko Ko Friday, February 22, 2013 9:43 AM
    • Unmarked as answer by Mr Ko Ko Friday, February 22, 2013 9:47 AM
    Friday, February 22, 2013 8:29 AM
  • Hi,

    Thank you for yuor prompt advice and actually, below is the best for me.

    byte[] data;
    string tmpStr = Encoding.UTF8.GetString(data, 0, data.Length);

    Best regards

    • Marked as answer by Mr Ko Ko Friday, February 22, 2013 9:42 AM
    Friday, February 22, 2013 9:42 AM