Remove file extension for display

I'd like to remove the extension from a file name. filename.pdf to just filename.

I attempted this code on the page:
"'Title: '+supporting_title.substr(0, supporting_title.lastIndexOf('.'))"
console responds -
parser.js:788 Method "lastIndexOf" not found in expression: 'Title: '+supporting_title.substr(0, supporting_title.lastIndexOf('.'))
A bit over my paygrade. Any guidance appreciated...

Try: "'Title: '+supporting_title.split('.')[0]"

2 Likes

What a world - from one island to another, 15 hours difference - but answer arrives - with a quick double check from the Netherlands.

As always much appreciated - THANK YOU

1 Like