Sting containing double quote .. ans please | Sololearn: Learn to code for FREE!
0

Sting containing double quote .. ans please

6th Mar 2017, 4:40 PM
JAMES BOND
JAMES BOND - avatar
2 Answers
+ 10
There's two ways of doing it. you can use double quotes within a string beginning with a single quote: 'She said "Hello!" ' or use \ to escape it (@Meharban Singh's answer) within a string beginning with double quotes: "She said \" Hello\" "
6th Mar 2017, 8:59 PM
Aidan Haddon-Wright
Aidan Haddon-Wright - avatar
+ 1
use \" to insert "
6th Mar 2017, 4:41 PM
Meharban Singh
Meharban Singh - avatar