Given a filename like:
package.zip image.jpeg video.avi etc
I'd like to remove the extension if exists. How can I make this in Java? THanks!
Open File Explorer and click View tab, Options. In Folder Options dialog, move to View tab, untick Hide extensions for known file types option, OK. Then you will se file's extension after its name, remove it.
Answer: No, Windows 10 does not have a duplicate finder in it yet.
Something like
if (name.indexOf(".") > 0)
name = name.substring(0, name.lastIndexOf("."));
The index check avoids turning hidden files like ".profile
" into "", and the lastIndexOf()
takes care of names like cute.kitty.jpg
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With