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

后端 未结 4 863
清酒与你
清酒与你 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 12:59

    You could use String.replace:

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

提交回复
热议问题