title: How do I replace all asterisks?
body: <p>In Java, I want to replace all <code>*</code> characters with <code>\*</code>.</p>
  
  <p>Example:
  Text: <code>select * from blah</code></p>
  
  <p>Result: <code>select \\* from blah</code></p>
  
  <pre><code>public static void main(String[] args) {
      String test = "select * from blah";
      test = test.replaceAll("*", "\\*");
      System.out.println(test);
  }
  </code></pre>
  
  <p>This does not work, nor does adding a escape backslash.</p>