我有一个地址并想更改一些元素,我的地址在下面:
var address = "http://20.0.1.8/x-manufacturer/senders/d7aa5a30-681d-4e72-92fb-f0ba0f6f4c3e/sample-data";
我想将var地址“sample=data”的最后一个索引的内容更改为“new-data”,我写了下面的代码来解决它,但没有给我我需要的东西!
let array_address = address.split('/');
var new address = array_address.splice(0,9,"new-data");//It just remove last index,didn't replace.
开心每一天1111
相关分类