how can I remove this URL section from this string (representing the URL) using old JavaScript?

后端 未结 4 675
清酒与你
清酒与你 2021-01-29 12:32

I am not so into JavaScript and I have the following problem.

I have a string like this:

https://smart.XXX.it/default.asp/s4

into a var

4条回答
  •  醉话见心
    2021-01-29 13:15

    a = 'https://smart.XXX.it/default.asp/s4';
    a = a.split('/');
    a = a.filter((item)=>{
    return item.indexOf('default.asp') === -1;
    });
    a = a.join('/');
    

提交回复
热议问题