How to write Null character in TextBox?

Nov 9 2009 4:55 PM
I have this piece of code, which is an event handler of a button1's click.

private void button1_Click(object sender, EventArgs e)
        {
            string str = "trj\0klk";
            textBox1.Text =c.ToString() ;
          
        }
As you can see in the previous code, i want to write "trj\0klk" string in the textBox1, but when i run this application, only "trj" appear in textBox1, because the compiler thought the character "\0" (the fourth character) is the null terminator character, so it stoped reading the string when reached it. How can I solve this problem?


Answers (6)