Use String.split() with multiple delimiters
I think you need to include the regex OR operator:
String[]tokens = pdfName.split("-|\\.");
What you have will match:
[DASH followed by DOT together] -.
not
[DASH or DOT any of them] -
or .
Try this regex "[-.]+"
. The + after treats consecutive delimiter chars as one. Remove plus if you do not want this.