sql - Asp.net 插入语句中的多个替换字符?
问题描述
我在我的 asp.net 网页中有一个 SQL 插入语句,如果“:”存在而没有任何内容“”,我必须替换测试框内容,如下所示
TextBox.Text.Replace(":", "")
有没有办法可以添加一个额外的字符来替换?如果输入到文本框中,我还需要删除“#”。
解决方案
我不知道这些是否可行,但值得一试:
TextBox.Text.Replace(":", "").Replace("#", "")
或者
String mytext = TextBox.Text;
mytext.Replace(":", "");
mytext.Replace("#", "");
TextBox.Text = mytext;
推荐阅读
- authentication - CakePHP 3.x - 在会话创建之前修改 Auth 组件中的用户数据
- python - 根据熊猫数据框MultiIndex中的多列值选择行
- javascript - 通过单击按钮显示 Div,隐藏其他
- php - 在 php 中解析无效 json_decode 数据的问题
- ruby - Cocoapods 安装失败,无法构建 gem 原生扩展
- javascript - 从具有锚点和图像标记的输入更新列表的 html
- google-visualization - 如何使用 google.visualization lib 获取对象?
- vue.js - 多个复选框上的 vuejs v-model
- regex - sed 匹配多行范围并替换
- angular - 从 Angular 4 项目中的另一个域加载 wordpress?