title: How to determine if string contains specific substring within the first X characters
body: <p>I want to check whether <code>Value1</code> below contains "abc" within the first X characters. How would you check this with an <code>if</code> statement?</p>
  
  <pre><code>var Value1 = "ddabcgghh";
  
  if (Value1.Contains("abc"))
  {
      found = true;
  }
  </code></pre>
  
  <p>It could be within the first 3, 4 or 5 characters.</p>