String withoutextension=filename.split("\\.") [0];
If you don't add the double anti slash, the '.' alone means no characters and you get an exception ArrayIndexOutOfBoundsException because the input string is a period ".". This exception is raised when java does not find the regex it is looking for and the output array is empty.
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...