cpp中的哪个函数读取了单词的结尾? [英] what function in cpp read end of word ?

查看:44
本文介绍了cpp中的哪个函数读取了单词的结尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想要检查单词结尾

然后删除单词结尾如果ing

解决方案

您可以定义一个起点std :: string :: find函数string.length() - 3(在本例中为ing的长度)然后使用string :: erase或string :: replace



参考文献:



http: //www.cplusplus.com/reference/string/string/find/ [ ^ ]



http://www.cplusplus.com/reference/string/string/length/ [ ^ ]



http://www.cplusplus.com/reference/string/string/erase/ [ ^ ]



etc


请检查一下你会找到你的解决方案



http://stackoverflow.com/questions/7853686 / C-FIND-返回最最后字内式字符串可变文本字符串getfirstwordt

want check end of word
then remove end of word if "ing "

解决方案

You can define a start point for the std::string::find function of string.length() - 3 (in this case the length of "ing") and then use string::erase or string::replace

References:

http://www.cplusplus.com/reference/string/string/find/[^]

http://www.cplusplus.com/reference/string/string/length/[^]

http://www.cplusplus.com/reference/string/string/erase/[^]

etc


Please check this you will Find your Solutions

http://stackoverflow.com/questions/7853686/c-find-return-the-last-word-in-the-string-variable-text-string-getfirstwordt


这篇关于cpp中的哪个函数读取了单词的结尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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