替换字符串中的撇号 [英] Replace apostrophe from a string

查看:114
本文介绍了替换字符串中的撇号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除字符串中的撇号?

How do I remove apostrophe in a string ?

推荐答案

请查看String.Replace [ ^ ]方法.只需将撇号替换为String.Empty.

您没有说要做什么,但是如果您打算通过这种小技巧来保护" SQL语句,请不要浪费您的时间.请改用参数化查询.
Look at the String.Replace[^] method. Just replace the apostrophe with a String.Empty.

You didn''t say what you''re were doing this for, but if you''re looking at "securing" your SQL statements with that little trick, don''t waste your time. Use parameterized queries instead.


这篇关于替换字符串中的撇号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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