I want to fetch last word dynamically
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 07:13 PM
Hi All ,
I want to fetch the last word from the short description and store in the one of the variable :
var gr= current.short_description;
var words = s.trim().split(gr);
var lengthOfLastWord = words[words.length - 1];
gs.print(lengthOfLastWord);
var ab=lengthOfLastWord;
This script is not fetching the last word .Can anyone help me .
Thanks and Regards,
Chandan