0

I have a string which has " characters inside, I have tried using '' to make it work but I get an erroe since I am trying to write that with streamwriter. I have checked some string formatting but couldn't find a way since using '' gave an error.

My string:

<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"

My Code:

         using (StreamWriter sw = File.AppendText(fileName))
        {
            sw.WriteLine('"<Invoice 
           xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"');

         }

I get a syntax error message saying " Error CS1012 Too many characters in character literal " but when I check the error it seems it is about string being too long and I don't thing that is the case here

Ezgi
  • 23
  • 6

0 Answers0