js字符串截取(获取指定字符后面的所有字符内容)

 

function getCaption(obj, text){
    let index = obj.lastIndexOf(text) + text.length-1;
    obj = obj.substring(index+1,obj.length);
    return obj;
 }
 let str=" 执法办案流程-立案审批";
 getCaption(str,'-');

  

posted @ 2022-03-30 14:17  PromiseOne  阅读(3019)  评论(0编辑  收藏  举报