开发者

How To Remove "Ctrl + Backspace" Special Character?

开发者 https://www.devze.com 2023-04-10 15:51 出处:网络
I have a server written开发者_运维技巧 in C++, and when receiving a chat string, I\'d like to remove weird special characters like the one created by Ctrl + Backspace (though not other symbols like :)

I have a server written开发者_运维技巧 in C++, and when receiving a chat string, I'd like to remove weird special characters like the one created by Ctrl + Backspace (though not other symbols like :)]>_ etc.)

I'm using Boost, too.

edit: Why'd this get -1'd? It's a legit question.


Sounds like isprint might help. It returns true for any printable character, ie. not for control characters and whitespaces. For a list of what is considered printable and what not, take a look at this table.


I haven't used it, and this probably isn't the best way to do it, but have you considered trying the boost regex library (i.e., regex_replace)?

0

精彩评论

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

关注公众号