I’m working on C++,
i have one string as follows:
string str = "rake::may.chipola::ninbn::myFuntion";
How to get last element from above string which is always after the last occurrence of “::”?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
std::string::rfind()to locate the last occurrence of::and usestd::string::substr()to extract the token: