title: Remove characters from a String in Java
body: <p>I am trying to remove the <code>.xml</code> part of a file name with the following code:</p>
  
  <pre><code>String id = fileR.getName();
                id.replace(".xml", "");
                idList.add(id);
  </code></pre>
  
  <p>The problem is that it is not removing it and I have no clue why it won't remove the target text. </p>
  
  <p><em><strong>EDIT</em></strong>: Actually I realize that the replace function won't find the <code>.xml</code>, so I guess the question is, how do I get rid of those last 4 characters? </p>
  
  <p>Here is the string that is being passed in:</p>
  
  <p><code>0b14d501a594442a01c6859541bcb3e8164d183d32937b851835442f69d5c94e.xml</code></p>
  
  <p>Thanks, </p>