title: How to check if a vector contains a specific character within specified indices?
body: <p>I would like to know how (if it is even possible) to search from the beginning of a vector up to a specified index if a character exists.</p>
  
  <p>Pseudocode:</p>
  
  <pre><code>vector&lt;char&gt; a{a, b, c, d, e, f, /*...*/};
  
  if (from a.begin() to a[2] b exists) {
  ... }
  </code></pre>
  
  <p>What is the most efficient way to do it?</p>