I have variable var str as following:
var str
var str = tea;
I would like to make it as below
Escape each single quote with a back-slash:
var quote_str = '\'tea;\''
…or wrap the string in quotes of a different kind (i.e. double quotes), but be sure to escape the inner double quotes as to not unintentionally close the string:
var quote_str = "'tea;'"