Java how to split from . (dot) or other character

Java how to split from . (dot) or other character

String textfile = "ReadMe.txt"; 

String filename = textfile.split(".")[0];

 String extension = textfile.split(".")[1];


Leave a Reply

Your email address will not be published. Required fields are marked *