Dmytro Pastovenskyi
Dmytro Pastovenskyi

Reputation: 5419

how to add " in a variable

I would like to add " chars into my string, is it possible? I'm avoiding this problem using ' char however I would like to use " if possible, thanks

here is an example what I do (and of course it does not work):

#set($options="<option value="1">my value</option>")

Upvotes: 0

Views: 87

Answers (2)

pgrosslicht
pgrosslicht

Reputation: 1701

You could try

#set($Q = '"')
#set($options="<option value=${Q}1${Q}>my value</option>")

Upvotes: 4

gaborsch
gaborsch

Reputation: 15758

Try

#set($options="<option value=\"1\">my value</option>")

Upvotes: 0

Related Questions