![]() |
Small C# Problem - quotation marks in string
Hi, im having trouble with quotation marks in a string.. here is the code that is bugging me..
:
html.WriteLine("<img src=""images//" & file & """ />");i need it to output the line as follows: <img src="images/imagename.jpg" /> the imagename.jpg is define in the file string. the errors are as follows: :
Error 1 ) expected C:\Documents and Settings\Jason\My Documents\Visual Studio 2005\Projects\Project01\Project01\Form1.cs 63 43 Project01thanks in advance... |
Use the escape sequence \" to display the quotation mark otherwise it will exit the string literal in the function argument.
html.WriteLine("<img src=\"images//\" & file & "\" />"); Or something along those lines. |
Quote:
|
Try this:
:
html.WriteLine("<img src=\"images//\"" + file + "\" />"); |
Ah, one quotation mark off, didn't spot that *headache looms*
|
Quote:
there were so many question marks i couldn't get my head round them all lol! :banana: |
You can use the @ before the strign, if i am not mistaken like :
:
@"<img src=""images//" & file & "" />" |
Quote:
thanks |
Quote:
Cheers for the tip, pegasus. |
| All times are GMT -5. The time now is 2:50 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC