javascript get filename from string -
i want first part of filename full filename, example, from:
bee_gees_-_stayin_alive.mp3
i want return: bee_gees_-_stayin_alive
how can it?
var filename = file.name; var name = filename.split('.'); var lastarray = name.length; var names = filename.split('.')[lastarray];
get index of last period in string , part of string before that.
example:
var fullname = "bee_gees_-_stayin_alive.mp3"; var name = fullname.substr(0, fullname.lastindexof('.'));
Comments
Post a Comment