How can I get the last word of a sentence using jQuery?
Examples:
get the last word of a sentence should return sentence
get the last word should return word
try this
var lastword = str.split(" ").pop();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With