任何人都可以解释Regex.Replace(txtTest.Text,“",string.Empty)这行. ... [英] can anyone explain Regex.Replace(txtTest.Text, "", string.Empty)this line..Also i had used editor/Ajax sanitizer bt might b i was missing some steps.so can also tel wht will be the proper steps...
问题描述
任何人都可以解释Regex.Replace(txtTest.Text,<.*?>",string.Empty)这行..我还使用过编辑器/Ajax消毒剂bt可能会缺少一些步骤.所以可以
can anyone explain Regex.Replace(txtTest.Text, "<.*?>", string.Empty)this line..Also i had used editor/Ajax sanitizer bt might b i was missing some steps.so can also tel wht will be the proper steps for adding sanitizer?
推荐答案
Regex.Replace
将检查您提到的字符(<.*?>),并将替换用<括起来的所有字符. >标签
例如:
Hi,
Regex.Replace
will check for character that you have mentioned(<.*?>)and it will replace all the characters that are enclosed with < > tags
Eg:
string st="Test";<br />
string str=Regex.Replace(st, "<.*?>", string.Empty);
输出:str="Test";
关于您的洗手液问题,请查看以下链接
http://stephenwalther.com/blog/archive/2011/08/01/ajax-control-toolkit-july-2011-release-and-the-new-html.aspx [ http://stephenwalther.com/blog/archive/2011/08/17/adding-the-new-html-editor-extender-to-a-web-forms.aspx [
Output: str="Test";
Regarding your sanitizer question please have a look on the following links
http://stephenwalther.com/blog/archive/2011/08/01/ajax-control-toolkit-july-2011-release-and-the-new-html.aspx[^]
http://stephenwalther.com/blog/archive/2011/08/17/adding-the-new-html-editor-extender-to-a-web-forms.aspx[^]
Hope this helps
Do let me know if you need any more details
许多应用程序可以帮助您学习正则表达式:
Expresso表单 http://www.ultrapico.com
csharpregexdemo
RegEx Builder表单 http://www.softpedia.com
Many applications may help you learn Regular Expressions:
Expresso form http://www.ultrapico.com
csharpregexdemo
RegEx Builder form http://www.softpedia.com
这篇关于任何人都可以解释Regex.Replace(txtTest.Text,“",string.Empty)这行. ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!