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
var url = 'https://smart.XXX.it/default.asp/s4';
var var2 = url.replace('default.asp/', '');
console.log(var2);
//Output
https://smart.XXX.it/s4
You could .split()
the url like such:
let url = 'https://smart.XXX.it/default.asp/s4'.split('/default.asp/').join('/');
console.log(url);
You could use String.replace
:
const url = 'https://smart.XXX.it/default.asp/s4'.replace('/default.asp', '');
console.log(url);
a = 'https://smart.XXX.it/default.asp/s4';
a = a.split('/');
a = a.filter((item)=>{
return item.indexOf('default.asp') === -1;
});
a = a.join('/');