Link to home
Start Free TrialLog in
Avatar of geeta_m9
geeta_m9

asked on

How to display a character of arrays in a textbox in Visual C#

This is related to a question I asked previously. I have an array of characters which I wish to assign to a textbox. To assign from the textbox to the array of characters, buffer, to the textbox, txtBox, I was given the following solution which works:

char[] buffer = System.Text.ASCIIEncoding.ASCII.GetChars(
                System.Text.ASCIIEncoding.ASCII.GetBytes(txtBox.Text));

Now, I need to do the opposite, but am not sure how to do it.

Would appreciate your help.
ASKER CERTIFIED SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use this:

foreach (char c in buffer ){
    txtBox.Text+= c.ToString();
}
gauthampjs' solution is much better. Please use that :)
dosent this work
buffer.ToString ();
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial