title: find if string starts with sub string using std::equal
body: <p>May you please point me to what is the wrong thing I am doing here?</p>
  
  <pre><code>auto is_start_with = [](std::string const&amp; whole_string, std::string const&amp; starting_substring)-&gt;bool{
          if (starting_substring.size() &gt; whole_string.size()) return false;
          return std::equal(begin(starting_substring), end(starting_substring), begin(whole_string));
      };
  </code></pre>
  
  <p>It is always return true.</p>
  
  <p>I know there is many many other solutions but I want to know what is the error here.</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Debuging!
  <a href="https://i.stack.imgur.com/dv67Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dv67Z.png" alt="enter image description here"></a></p>
  
  <p>P.S. I tried it in other main file with directly entering the strings and it worked!!</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>I deleted two to lower transforms before the comparison and it worked!</p>
  
  <pre><code>std::transform(std::begin(fd_name), std::end(fd_name), std::begin(fd_name), ::tolower);
  std::transform(std::begin(type_id), std::end(type_id), std::begin(type_id_lower), ::tolower);
  </code></pre>