Peter Price

Peter Price

  • NA
  • 3
  • 0

Displaying character arrays

Apr 16 2009 12:52 AM
How do I display a character array?  I copy a string to a character array using the 'CopyTo' method, but when I attempt to display the character array in any of the following ways:
   Console.WriteLine("2nd char_array value is {0}", char_array); 
   Console.WriteLine("3rd char_array value is " + Convert.ToString(char_array));
   string newstring;
   newstring = Convert.ToString(char_array);
   Console.WriteLine("4th char_array value is " + newstring);

I get the results:
2nd char_array value is System.Char[]
3rd char_array value is System.Char[]
4th char_array value is System.Char[]
 
Instead of the value in char_array.

Thanks for your help.

Peter Price







Answers (1)