大家好,我將有一個字符串,在連字符隔開,我想獲得字符串的lastIndex,並與新的價值在jquery中用連字符分割字符串後獲取最後一個值?
var str1="New-New_Folder"; //Replace New_Folder with Folder so that the str becomes
var newstr1="New-Folder";
var str2="New-New_Folder-New_Folder"; //Replace the last New_Folder with Sub_Folder so that the str becomes
var newstr2="New-New_Folder-Sub_Folder";
更換任何一個可以幫助我在這裏?
我讀過這兩次,現在,我仍然不能確定你在問什麼。你想要替換什麼字符串?你想用*代替它? –