我使用了replace(“[^-A-Za-z0-9()%.],但它为'我可以解决这个错误吗

i have used replace("[^-A-Za-z0-9()%.] but it throws error missing comma for ' come can i resolve this error

本文关键字:我可以 解决 错误 replace -A-Za-z0-9      更新时间:2023-09-26

我使用了替换("[^-A-Za-z0-9()%.],但它为'抛出了一个缺少逗号的错误(撇号)我该如何解决此错误。

每一个其他特殊字符都被替换或没有抛出错误

您可以使用正则表达式验证器Regex验证器

此外,在replace方法中,您必须提供源字符串以及希望用替换的字符串