title: java parameter replacement in a String
body: <p>I'ms looking for a way to replace my variables in a string by their value. Here is my string lookalike:</p>
  
  <pre><code>"cp $myfile1 $myfile2"
  </code></pre>
  
  <p>In fact, I looked the javadoc and it seems that I could use split() method from String class which is good but I have also seen an article on which it seems that it is possible to replace all my variables with regex and replaceAll() method. Unfortunately I didnt find any example on the last solution.</p>
  
  <p>Is it possible to use replaceAll in my case (with an example)?</p>