Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stringtemplate with dollar sign

What is the best way to deal with dollar sign in stringtemplate.

For example I need following template:

You can purchase item $name$ for $5
like image 775
Alexey Avatar asked May 22 '26 03:05

Alexey


2 Answers

Have you tried escaping the $?

You can purchase item $name$ for \$5

You should use escaping, for example \$

like image 37
gaborsch Avatar answered May 23 '26 17:05

gaborsch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!