I'm trying to remove the last character of a filename but only if it matches a hyphon, eg...
- Code: Select all
filename.jpeg
filename-.png --> filename.png
file name.doc
file name 3.mp4
file name -.dxg --> file name .dxg
file.name.mov
file-name-.mov --> file-name.mov
file-name.mov
Note: The filename may contain other hyphons and other valid non alphanumeric characters.
Hope that makes sense??
Cheers!