title: Get filename without extension from full path
body: <p>I am making a program to store data from excel files in database.  I would like the user to give in console the full path of the file and after the program to take only the file name to continue.</p>
  
  <p>The code for loading the full path is: </p>
  
  <pre><code>String strfullPath = "";
  Scanner scanner = new Scanner(System.in);
  System.out.println("Please enter the fullpath of the file");
  strfullPath = scanner.nextLine();
  String file = strfullPath.substring(strfullPath.lastIndexOf('/') + 1);
  System.out.println(file.substring(0, file.indexOf('.')));
  </code></pre>
  
  <p>After that I would like to have: <code>String filename = .......</code></p>
  
  <p>The full path that the user would type would be like this: <code>C:\\Users\\myfiles\\Documents\\test9.xls</code></p>
  
  <p>The filename that I would create would take only the name without the <code>.xls</code>!
  Could anyone help me how I would do this?</p>
  
  <p>How i would do it if i would like to take as filename "test9.xls" ? –</p>