在C类Java lastIndexOf ++ [英] Java-like lastIndexOf in c++
本文介绍了在C类Java lastIndexOf ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在执行升压和C ++的一些研究,但未能找到有关我的问题什么。是否有一个Boost库或STL函数实现的 lastIndexOf ?
I performed some research on boost and c++ but could not locate anything relevant to my question. Is there an boost library or STL function that implements lastIndexOf?
推荐答案
的std ::字符串
的成员函数的 rfind()
从结束搜索,如发现返回的索引或的std ::字符串::非营利组织
如果不是。从链接参考页:
std::string
has the member function rfind()
which searches from the end and returns the index if found or std::string::npos
if not. From the linked reference page:
查找的最后一个子等于给定的字符序列。
Finds the last substring equal to the given character sequence.
这篇关于在C类Java lastIndexOf ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文