#include <string>
// return true if there is only one of the characters in searched_letters
// (default: only one of "abcdefxyz" )
bool determineLetter( const std::string& str, const std::string& searched_letters = "abcdefxyz" )
{
// https://en.cppreference.com/w/cpp/string/basic_string/find_first_ofconstauto pos = str.find_first_of(searched_letters) ;
return ( pos != std::string::npos ) // return true if 1. we found the first one
&& ( str.find_last_of(searched_letters) == pos ) ; // and 2. it is the only one
}