get word after last occurrence of string js code example Example: find the last occurrence of a character in a string javascript str.lastIndexOf(searchValue[, fromIndex])