SyntaxFix
Write A Post
Hire A Developer
Questions
I believe you should escape the dot. Try:
String filename = "D:/some folder/001.docx"; String extensionRemoved = filename.split("\\.")[0];
Otherwise dot is interpreted as any character in regular expressions.