title: How to replace a String in java which contains dot?
body: <p>I need to replace a String which contains white space and periods. I have tried with the following code:</p>
  
  <pre><code>String customerName = "Mr. Raj Kumar";
  
  customerName = customerName.replaceAll(" ", "");
  System.out.println("customerName"+customerName);
  
  customerName = customerName.replaceAll(".", "");
  System.out.println("customerName"+customerName); 
  </code></pre>
  
  <p>but this results in:</p>
  
  <blockquote>
    <p>customerName Mr.RajKumar</p>
  </blockquote>
  
  <p>And</p>
  
  <blockquote>
    <p>customerName</p>
  </blockquote>
  
  <p>I am getting the correct customer name from the first SOP, but from second SOP I am not getting any value.</p>