JS字符串截取(獲取指定字符后面的所有字符內容)
function getCaption(obj){ var index=obj.lastIndexOf("\-"); obj=obj.substring(index+1,obj.length ...
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 ...
可以先替換成你需要的特殊字符,然后創建一個可以找到特殊字符第n個索引 ...
獲取字符在字符串中的位置 截取指定位置字符 分割字符串 字符串以特定串開始 是否包含字符串 ...
一個常見的場景,獲取:標簽背景圖片鏈接: 如字符串:var bgImg = "url(\"https://img30.360buyimg.com/sku/jfs/t26203/262/100869187/204098/1d1479e9/5b84b80bNf39db45f.jpg ...