title: C++ Splitt string and remove specific part of string
body: <p>I want to save only dates in a vector and remove time. How can I do it in the best way?</p>
  <pre><code>string text = &quot;16.04.2021 02:00&quot;;
  char space_char = ' ';
  std::vector&lt;std::string&gt; tokens;
  std::string token;
  std::istringstream tokenStream(text);
  while (std::getline(tokenStream, token, space_char))
  {
      tokens.push_back(token);
      
  }
  for (const auto&amp; str : tokens) {
      cout &lt;&lt; str &lt;&lt; endl;
  }
  </code></pre>