Strings Are Enclosed In Double Quotation Marks While String Literals

[Solved] Strings Are Enclosed In Double Quotation Marks While String Literals | Vb - Code Explorer | yomemimo.com
Question : strings are enclosed in double quotation marks while string literals are enclosed in single quotation marks.

Answered by : richard-john

Single-Quoted strings: While using single-quoted strings for defining string literals, we only need to escape the single quote inside the string. While there is no need to escape double-quote and can be written exactly
<script>	const geeks = 'We will visit \'GeeksforGeeks\' student.';	const hello = 'Hello, I am an "Engineer"';	document.write(geeks + "<br>");	document.write(hello)
</script>
While using double-quoted strings for defining string literals, we only need to escape the double-quote inside the string. While there is no need to escape single-quote and can be written exactly
<script>	const geeks = "We will visit \"GeeksforGeeks\" student."	const hello = "Hello, I am an 'Engineer'"	document.write(geeks+"<br>")	document.write(hello)
</script>

Source : https://www.geeksforgeeks.or | Last Update : Wed, 31 Aug 22

Answers related to strings are enclosed in double quotation marks while string literals are enclosed in single quotation marks

Code Explorer Popular Question For Vb