63 thumbs up

Ordinary People Discovering Extraordinary Abilities

Not So Smart Builder

Get a C# string from text box

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...


Share Send to a friend Watch Report
 
 

Posted Answers

Order by
 
30 thumbs up

Use TextBox.Text

 


Posted 2 years ago ( permalink )
In reply to dudushmaya's question
Rated as
#2 out of 5
0
1

Helpful?

line
line
line



 
30 thumbs up

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");

 


Posted 2 years ago ( permalink )
In reply to dudushmaya's question
Rated as
Best Answer
0
4

Helpful?

line
line
line



 

sfsdfssdsdfsdfsfsdfsdfsdfsdfds

sdfsdfsdffdfdfffsdfsddsfddsfdfd


Posted 7 months ago ( permalink )
In reply to dudushmaya's question
Rated as
#3 out of 5
0
0

Helpful?

line
line
line



 
  • ddsfdsdfsdfsdfsdfsd
  1. fddfFrowndsfdsfds

Posted 7 months ago ( permalink )
In reply to tprabu's answer
Rated as
#4 out of 5
0
0

Helpful?

line
line
line



 

How can i get the source code for this?


Posted 7 months ago ( permalink )
In reply to dudushmaya's question
Rated as
#5 out of 5
0
0

Helpful?

line
line
line



Sign in to participate

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).

Explore Related Questions

Other people asked questions on similar topics, check out the answers they received:


What is c#

what is c#
Submitted by pradeepbaloni 5 months ago
  • viewed 262 times

Last answer posted 4 months ago by Eran


Hi, Do you have a sample C# code to use google or ...

Hi, Do you have a sample C# code to use google or yahoo id to signup/login to the website? please reply me at prasadvemala@gmail ...
Submitted by prasad 24 days ago
  • viewed 29 times

Last answer posted 10 days ago by prasad


How can i convert the integer into string on linq ...

how can i convert the integer into string on linq database by using c#
Submitted by muneesh 6 months ago
  • viewed 765 times

Last answer posted 5 months ago by Eran
</