For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let\'s assume the file nam
x = filename.jpg
filename
Another one-liner:
x.split(".").slice(0, -1).join(".")