C# @string

  • Thread starter Thread starter KrisK
  • Start date Start date
K

KrisK

How to do it simply:

string ss = @"tab\tnotab\n";

Write.Console(ss); // prints \t \n

How to reinterpret \t and \n

Thank you
 
Remove the @ from the 'ss' string declaration. The @ tells the compiler
that the \t and \n are to be stored literally instead of as tabs and newline
characters respectively.

David
 
David I know, but I have string already with \t etc..
and I want it to reinterpreted it (some sort of eval on it)
KK
 
Krisk said:
David I know, but I have string already with \t etc..
and I want it to reinterpreted it (some sort of eval on it)

Do something like:

ss = ss.Replace ("\\t", "\t").Replace ("\\r", "\r");
ss = ss.Replace ("\\n", "\n").Replace ("\\\\", "\\");
 
Jon,

thank you v. much

you may find this useful, I found it after some search:
System.Reflection.Assembly.GetExecutingAssembly().GetName
().Version

I dare to say: simple things are most difficult

KK
 
Back
Top