I am wondering if I am going about splitting a string on a . the right way? My code is:
.
String[] fn = filename.split(\".\"); return fn[0];
split() accepts a regular expression, so you need to escape . to not consider it as a regex meta character. Here's an example :
split()
String[] fn = filename.split("\\."); return fn[0];