What's the fastest method, to remove a specific extension from a String by not using regexp (.html, .htm, .xml or whatever you feed it with) ?
I need this to convert ~500 strings <1s at once.
example:
var myURL = 'home/johndoe/likes/pepsico.html'
var result = 'home/johndoe/likes/pepsico'
EDIT :
var alias = window.location.pathname //'/home/johndoe/likes/pepsico.html'
alias = alias.substr(alias.indexOf('/') + 1)
alias = alias.substr( 0, alias.lastIndexOf('.') );
how can i optimize this ?