I need to make a string with the following content:
<head>
<meta name="keywords" content="HTML, meta tags, metadata" />
</head>
Because of all of the quotation marks, not all of the words are included.
I need to make a string with the following content:
<head>
<meta name="keywords" content="HTML, meta tags, metadata" />
</head>
Because of all of the quotation marks, not all of the words are included.
I think you're looking for this
String str = "<head>\n<meta name=\"keywords\" "
+ "content=\"HTML, meta tags, metadata\" />\n</head>";
System.out.println(str);
Which outputs
<head>
<meta name="keywords" content="HTML, meta tags, metadata" />
</head>
you can escape the individual quotations:
<head>
<meta name=\"keywords\" content=\"HTML, meta tags, metadata\" />
</head>