截取逗号后面所有字符

/*
 * 截取逗号后面所有字符
 */
function getCaption(obj){
    var index=obj.lastIndexOf("\,");
    obj = obj.substring(index+1,obj.length);
    return obj;
}
var str="dsafas,立案审批djsld13";
getCaption(str);
console.log(getCaption(str));

  

alert(('dhak^456').split("^")[0])
alert(('dhak^456').split("^")[1])

posted @ 2017-12-19 13:55  velin  阅读(1380)  评论(0编辑  收藏  举报