fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. String sOrigFileName ="ECUW_12_LEHORN1790406_AttachedList_OBL.pdf";
  14.  
  15. String sBLNumberRef =sOrigFileName.toUpperCase().replace("ECUW_12_","");
  16. System.out.println("HERE 1 "+sBLNumberRef);
  17. sBLNumberRef = sBLNumberRef.substring(0,sBLNumberRef.toUpperCase().indexOf("_"));
  18. System.out.println("HERE 2 "+sBLNumberRef);
  19. sBLNumberRef =sBLNumberRef.replace(" ","");
  20.  
  21. System.out.println("HERE 3 "+sBLNumberRef);
  22.  
  23. }
  24. }
Success #stdin #stdout 0.12s 50100KB
stdin
Standard input is empty
stdout
HERE 1 LEHORN1790406_ATTACHEDLIST_OBL.PDF
HERE 2 LEHORN1790406
HERE 3 LEHORN1790406