Looking for a way to remove a full URL from a string with JavaScript? Let's take a look on how to do it with our quick code snippet:
const url = "Visit this page https://www.kodekativ.co/example-url/ as a url";
const result = url.replace(/(?:https?|ftp):\/\/[\n\S]+/g, '');
console.log("Removed url result: ", result);
The result:
Visit this page as a url