str = "12345?789”str.split("?")[0] 输出为 12345 str.split("?")[1] 输出为 789 讲解:(split("?")为指定分割字符;[0]为分割后取前面的值,[1]为分割后取后面的值) ...
str = "12345?789”str.split("?")[0] 输出为 12345 str.split("?")[1] 输出为 789 讲解:(split("?")为指定分割字符;[0]为分割后取前面的值,[1]为分割后取后面的值) ...
参考:https://blog.csdn.net/maqinqin/article/details/5323824 ...
输出:A|B ...
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(index+1,obj.length ...
JS字符串截取(获取指定字符后面的所有字符内容) function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring ...
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(inde ...
function getCaption(obj, text){ let index = obj.lastIndexOf(text) + text.length-1; obj ...
获取字符在字符串中的位置 截取指定位置字符 分割字符串 字符串以特定串开始 是否包含字符串 ...