I am displaying a message to the user like so:
Messagebox.Show("I am a \"Test\" Message.\r\nAm I working?");
and that works fine.
But now I add my message to a Sql database
as an nvarchar(max)
and retrive it from the database but now my messagebox shows everything including the \"
so when I do:
Messagebox.Show(databaseString)
It displays the literal string:
I am a \"Test\" Message.\r\nAm I working?
Instead of:
I am a "Test" Message.
Am I working?"
How do I get rid of the \"
and \r\n
when I get my string from a database? Do I need to encode it?
PS. I don't want to use String.Replace
as there could be more uses in the future i.e. \t