js截取指定字符前面或后面的内容
getCaption(obj, state,strname) { var index = obj.lastIndexOf(strname); if (state == 0) { obj = obj.substring(0, index); } else { obj = obj.substring(index + 1, obj.length); } return obj; }
//调用
getCaption('abcefefef/9jccdmcdcmdm',1,"/9j") //9jccdmcdcmdm