Convert a literal string to a normal string

C

Clemens Hoffmann

Hello,

i use resources to store code fragments.
This fragments contain sequences with line
feed and tabs (i.e: "\r\n\t\t").

When reading the text from the resource
it is a literal string (in the debugger it is
stated with a @ character in from of it.

When writing the fragment to a file the
line feed and tab character are not written
to the file. The fragment is written as is.

How can i convert a literal string into
a standard string that then can be written
correctly to the file?

greetings

Clemens Hoffmann
 
N

Nicholas Paldino [.NET/C# MVP]

Clemens,

If I understand you correctly, you basically want to do a replace on the
string, finding all instances of \r, \n and \t, and replacing them with the
appropriate character literals. You should be able to use the Replace
function on the string class to do this.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top