This question has been asked a couple of times here on SO, but most answers are simply slow. I need the fastest implementation possible since I execute this on million filenames in a list.
filename.split(".").pop();
The code above works but imagine a long filename, isn't there a way to start from the right? Otherwise, i could imagine that this here is faster than the common answers:
filename.reverse().split(".", 1).reverse()