[题目链接]

string func(string s)
{
string tmp;
string::iterator it = s.begin();
while (it != s.end())
{
if (*it <= 90 && *it>=65)
{
tmp += *it + 32;
}
else if(*it <= 122 && *it>=97)
{
tmp += *it;
}
else if (*it <= 57 && *it >= 48)
{
tmp += *it;
}
it++;
}
return tmp;
}
class Solution {
public:
bool isPalindrome(string s) {
string s1 = func(s);
string::iterator it = s1.begin();
string::reverse_iterator rit = s1.rbegin();
while (it!=s1.end())
{
if (*it != *rit)
{
return false;
}
else
{
it++;
rit++;
}
}
return true;
}
};
