
9 Sep
2008
9 Sep
'08
1:29 p.m.
Hello, I have the following program: #include <string> #include <boost/algorithm/string/classification.hpp> #include <boost/algorithm/string/finder.hpp> int main() { std::string str("12.5e"); boost::last_finder(str,boost::is_digit()); // <--- is this sort of right? } What I'm trying to do is find the last occurence of a digit in my string (and learn a bit more about Boost.StringAlgorithms!). Am I going down the correct route here, and if so would someone be so kind to add to my program to show how I could obtain and output the index? The call operator for last_finder accepts two paramters which has thrown me as I thought the range was defined at construction. Thanks in advance, Pete