开发者

C# regular expression '+' character

开发者 https://www.devze.com 2023-01-25 01:06 出处:网络
How do I use C# regular expressions to search for special characters (like \'+\' in this case)? I would usually just use 开发者_如何学Python+ in perl / ruby, but I can\'t seem to figure out how to do

How do I use C# regular expressions to search for special characters (like '+' in this case)?

I would usually just use 开发者_如何学Python+ in perl / ruby, but I can't seem to figure out how to do this in C#. Thanks for any help you can provide.


use backslash to escape special characters


Backslashes work fine. As an alternative, you could use a character class for this and use [+] to match "+".

0

精彩评论

暂无评论...
验证码 换一张
取 消