0 votes
1 view
in Java by (10.2k points)

What's the most efficient way to trim the suffix in Java, like this:

title part1.txt

title part2.html

=>

title part1

title part2

1 Answer

0 votes
by (46.1k points)

This is the sort of code that we shouldn't be doing ourselves. Use libraries for the mundane stuff, save your brain for the hard stuff.

In this case, I recommend using FilenameUtils.removeExtension() from Apache Commons IO

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...