使用正则表达式查找您的字符串中是否有 URL,如果他们只是替换它您在该空间上需要的内容/(https?://[^\s]+)/gvar string = "Hi Vignesh This is Mondi from Novato Cleaners. May I ask for a favor ? Our google https://bit.ly requires reviews. Could you provide one ?Thank you";var protomatch = /(https?:\/\/[^\s]+)/g;var b = string.replace(protomatch, '');console.log(b)