title: Java: Replace all ' in a string with \'
body: <p>I need to escape all quotes (') in a string, so it becomes \'</p>
  
  <p>I've tried using replaceAll, but it doesn't do anything. For some reason I can't get the regex to work.</p>
  
  <p>I'm trying with</p>
  
  <pre><code>String s = "You'll be totally awesome, I'm really terrible";
  String shouldBecome = "You\'ll be totally awesome, I\'m really terrible";
  s = s.replaceAll("'","\\'"); // Doesn't do anything
  s = s.replaceAll("\'","\\'"); // Doesn't do anything
  s = s.replaceAll("\\'","\\'"); // Doesn't do anything
  </code></pre>
  
  <p>I'm really stuck here, hope somebody can help me here.</p>
  
  <p>Thanks,</p>
  
  <p>Iwan</p>