How to get rid of the file type when using getName()?
<p>Only doing this because I am lazy. I just wrote a program to list all my music into an excel file.</p>

<pre><code>   import java.io.*;
   import org.apache.commons.io.FileUtils;

      public class NewClass {

        public static void main( String args[] ) 
        {
           File folder = new File("C:/Users/Public/Music/OldMusic");
           File[] listOfFiles = folder.listFiles();

            for (int i = 0; i &lt; listOfFiles.length; i++) {
             try{
                 FileUtils.writeStringToFile(new File("test.xls"), listOfFiles[i].getName(), true);
                 BufferedWriter output;
                 output = new BufferedWriter(new FileWriter("test.xls", true));
                 output.newLine();
                 output.close();
             }
             catch (IOException e){
             }
          }
      }
     }
</code></pre>

<p>The code works fine, but at the end of every song there is <em>.mp3</em> (i.e.: <em>Metallica - Nothing Else Matters.mp3</em>).</p>

<p>Is there a way just to have the Name of the song without the <em>.mp3</em> at the end of it?</p>
