Getting complex text as a string

abc @cnn("sujsl d(*) sfv @nor dsf ",dn,".",@tn); ator '`,`') sds @cns1 or '`,"\','\",`') fdhg @cns2 sf \",dn,"; nj 

How can I get this text as a string in C #. This is simply impossible to do because of what I contained. " I would rather insert it, however, instead of replicating " using \" since there are already such things in my text

One way is to insert it into a static text box (textBox1) and then get it as text of a text field (if I need to use this in winform), for example. string st = textBox1.Text

How can this type of text be obtained in a string variable without using a text field?

+4
source share
2 answers

This is a good example for resource files. They will allow you to enter string literals without fear of escape of any kind and available to you programmatically. See Link http://msdn.microsoft.com/en-us/library/3xhwfctz(v=vs.100).aspx

+4
source

Look at string literals ; this may be what you are looking for.

+1
source

Source: https://habr.com/ru/post/1438089/


All Articles