I'ms looking for a way to replace my variables in a string by their value. Here is my string lookalike:
"cp $myfile1 $myfile2"
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.
Is it possible to use replaceAll in my case (with an example)?