Tables and conversions.
First, I would convert the string to any of uppercase or lowercase letters:
#include <cctype>
#include <algorithm>
#include <string>
std::string test_string("mR BroWn");
std::transform(test_string.begin(), test_string.end(),
test_string.begin(),
std::tolower);
Then I will check for exceptions or use the equivalence table. If the character in question is in an array of exception characters, then use the equivalence table.
source
share