js split string on last occurrence of characetr code example
Example: js split last occurence
var lastIndex = src.lastIndexOf('.');
// Add the string before the last .
// Return updated string, this will update the src attribute value
return src.substr(0, lastIndex) + '-fx' + src.substr(lastIndex);