Answers for "nodejs remove extension from filename"

2

exclude extension from filename javascript

const file = 'test.jpg';
const filename = file.split('.').slice(0, -1).join('.');
Posted by: Guest on June-22-2020
1

javascript remove extension from filename

// using string methods only
filename.substring(0, filename.lastIndexOf('.')) || filename

// using both string & array methods
filename.split('.').slice(0, -1).join('.')
Posted by: Guest on October-02-2021
0

node js get file name without extension

filename.split('.').slice(0, -1).join('.')
Posted by: Guest on October-04-2020

Code answers related to "nodejs remove extension from filename"

Code answers related to "Javascript"

Browse Popular Code Answers by Language