title: Problem in determining the polindrome string
body: <p>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:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
  bool polindrom(string pol)
  {
      int len = pol.length();
      for (int i = 0; i &lt; len / 2; i++)
      {
          if (pol[i] != pol[len - i - 1])
          {
              return false;
          }
          return true;
      }
  }
  
  int main()
  {
      string pol;
      cout &lt;&lt; "Enter the phrase: " &lt;&lt; endl;
      cin &gt;&gt; pol;
      if (polindrom(pol))
      {
          cout &lt;&lt; "This phrase is a polindrome.";
      }
      else
      {
          cout &lt;&lt; "This phrase is not a polindrome.";
      }
      cout &lt;&lt; endl;
      system("pause");
  } 
  </code></pre>
  
  <p>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?</p>