var myString = "I want to remove the last word"; var mySplitResult = myString.split(" "); var lastWord = mySplitResult[mySplitResult.length-1]