Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove last word from string javascript

var myString = "I want to remove the last word";
var mySplitResult = myString.split(" ");
var lastWord =  mySplitResult[mySplitResult.length-1] 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #word #string #javascript
ADD COMMENT
Topic
Name
2+6 =