【发布时间】:2019-09-17 04:31:18
【问题描述】:
我需要从文本框中排除特殊字符(%,&,/,",' 等)
有可能吗?我应该使用 key_press 事件吗?
string one = radTextBoxControl1.Text.Replace("/", "");
string two = one.Replace("%", "");
//more string
radTextBoxControl1.Text = two;
在这个模式下很长=(
【问题讨论】:
-
什么样的文本框?表格? WPF? ASP.NET? Windows 8 商店?
-
请在您尝试过的问题中添加一些代码。
-
字符串一 = radTextBoxControl1.Text.Replace("/", "");字符串二 = one.Replace("%", ""); //more string radTextBoxControl1.Text = two;
-
radTextBoxControl 表示您正在使用 Telerik 控件。为什么不直接使用蒙版编辑控件。顺便说一句,我宁愿让随机密钥不做任何事情的验证失败。还有为什么你不能允许这些值?