如何查找特殊字符并用c#中的名称替换? [英] How can I find the special characters and replace with the names in c# ?

查看:111
本文介绍了如何查找特殊字符并用c#中的名称替换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用此代码,

i try this code,

string s="hari";
string b = "@ boyapati";
js = " var visitorName = "+ s +";" +
  "var myOldString = "+ b +";"+
  "+ myNewString +" = myOldString.replace(/@/g, visitorName);";

}         



但不起作用.



but not working.

推荐答案

我不确定您编写的代码,尤其是javascript.我不认为它将运行.

然而.您可以在C#和Javascript中使用正则表达式来实现目标
I am not sure about the code that u have written especially the javascript. i dont think it will run.

however. you can use regular expression in C# and Javascript to achieve the objective


这篇关于如何查找特殊字符并用c#中的名称替换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆