Firstly, I do not have the option to use Regular Expressions. It pains me to say this.
My problem is I may have a std::string that might contain something like:
std::string someString = "(U//DISTRIBUTION//DONE)".
What i’d like to do is search the string for just the captial U and nothing else around it. In other words, I want to exclude and finds on a U that are surrounded by other letters. Would it be better to tokenize on the delimeter or is there a better way?
Make sure that you pad your searchee string with leading and trailing
//(if it’s not already present) and then usesomeString.find("//U//") != std::string::npos.