Convert a literal string to a normal string

  • Thread starter Thread starter Clemens Hoffmann
  • Start date Start date
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
 
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.
 
Back
Top