title: Replacing a variable with a value in Java
body: <p>I have a string that has certain variables like <code>"This is string containing $variable$"</code>. I want to replace this <code>$variable$</code> with a new string. If I use replaceall method like <code>str.replaceall("$variable$","new_value")</code> it is not getting replaced. But if I give without <code>$</code> symbols, it is replacing. But my output is like this, <code>$new_value$</code>.
  I need it without the <code>$</code> symbol.</p>