How can I insert a string before the extension in an image filename? For example, I need to convert this:
../Course/Assess/Responsive_Course_1_1.png
Use javascript lastIndexOf, something like:
var s = "Courses/Assess/Responsive_Cousre_1_1.png"; var new_string = s.substring(0, s.lastIndexOf(".")) + "_large" + s.substring(s.lastIndexOf("."));