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

后端 未结 4 676
清酒与你
清酒与你 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条回答
  •  梦毁少年i
    2021-01-29 12:58

    var url = 'https://smart.XXX.it/default.asp/s4';
    var var2 = url.replace('default.asp/', '');
    console.log(var2);
    //Output
    https://smart.XXX.it/s4
    

提交回复
热议问题