I need to fetch the last word from the URL provided in the description. For example, there is a description which contains one URL and some other text and the last word in the URL changes from one page to other (using JavaScript).
I need to use the last word of the URL to fetch the records. Could you please help me with this.
If you know the character that separates the word from the rest of the URL, you can use the
splitmethod that returns an array of strings. From that one, the last element is your word.Eg for “&” as separator: