we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "js split last occurence"
Issam
05 Aug 2016
1  var lastIndex = src.lastIndexOf('.');
2
3  // Add the string before the last .
4  // Return updated string, this will update the src attribute value
5  return src.substr(0, lastIndex) + '-fx' + src.substr(lastIndex);