[Solved] searching sub string in string and check another string before that [closed]
Here ya go, use std::string::find: // Notice the double quotes std::string::size_type position = my_string.find(“34”); bool found = ((position != std::string::npos) && (position > 0) && (my_string[position – 1] == ‘6’)); The find method returns the position of substring, or std::string::npos if it is not found. The position must be greater than 0, because of the … Read more