Ordinary People Discovering Extraordinary Abilities
Not So Smart Builder
How do I get a C# string from a text box?
If I have a text box with new lines and tabs I want to get the real C# string for it with \r\n and \t...
Use TextBox.Text
If you want the string to have the string representation of \t, \r and \n, simply use String.Replace()
i.e.
String.Replace("\t","\\t");
sfsdfssdsdfsdfsfsdfsdfsdfsdfdssdfsdfsdffdfdfffsdfsddsfddsfdfd
sfsdfssdsdfsdfsfsdfsdfsdfsdfds
sdfsdfsdffdfdfffsdfsddsfddsfdfd
fddf
How can i get the source code for this?
Got an answer for dudushmaya? Would you like to comment on the posted answers, or vote for the one which you think is the best?
Sign up for a free account, or sign in (if you're already a member).
Other people asked questions on similar topics, check out the answers they received: