A task was given in which it was necessary to determine whether the entered word (or phrase) is a palindrome (this is a verbal construction that can be read both from left to right and from right to left). As a result, finding the word palindrome did not cause any special problems for me, here is the code:

```
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

bool polindrom(string pol)
{
    int len = pol.length();
    for (int i = 0; i < len / 2; i++)
    {
        if (pol[i] != pol[len - i - 1])
        {
            return false;
        }
        return true;
    }
}

int main()
{
    string pol;
    cout << "Enter the phrase: " << endl;
    cin >> pol;
    if (polindrom(pol))
    {
        cout << "This phrase is a polindrome.";
    }
    else
    {
        cout << "This phrase is not a polindrome.";
    }
    cout << endl;
    system("pause");
} 

```

However, if you enter an expression-palindrome (for example, Able was I ere I saw Elba), then the program will no longer be able to determine what it is. Moreover, by the condition of the task, it is also necessary to delete everything that is entered after the point (including the point itself). Help implement this. I understand that when you enter an expression, the program starts reading spaces, but of course they do not converge from the left and right sides, only how can we make it ignore and not read spaces and capital letters?