Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing out Quotes " in a text file

Status
Not open for further replies.

ioseph

Programmer
Sep 6, 2005
11
GB
Hi,
Does anyone know how to write out quotes in a text file using the File class e.g
I want the file to say <?xml version="1.0"....>

I am currently doing this -
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine("<?xml version='1.0'>");
}

this returns <?xml version='1.0'....> which is no good
ANY IDEAS???
 
you need to escape the quotes with a [red]\[/red], like below
sw.WriteLine("<?xml version=\"1.0\">");


I'm the Chairman of the Bored
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top