I am having problems removing the baseUrl from a Url.
I have to string
var baseUrl = 'https://www.stackoverflow.com';
var Url = 'https://www.stackoverflow.com/test/number/';
Url.replace(baseUrl, "");
Now i would expect the result to be /test/number/
but it does not remove the first part of the string.
The Code is an example. I do not always know for sure if the baseUrl is a substring so I cannot cut the length.
Any Ideas?