title: Checking If a String Contains a Word and Then Checking If It Starts With said Word and If It Doesnt?
body: <p>Having another tough one here guys, basically I would like to check if a string contains the word "Foo" and if it does contain it, does it start with it? If it does start with Foo, it should be the only Foo that starts with a capital, all others should be small letters.</p>
  
  <p>If the above criteria is met, it should return true.</p>
  
  <p>If the string contains Foo but doesn't start with Foo, it should immediately return false since you cant have a capital Foo in the middle of the string.</p>
  
  <p>In the event that said string contains foo, but doesn't start with Foo, all instances of foo should be lowercase. If this criteria is met, return true.</p>
  
  <p>I should mention i am looking for C# code, I tried and have not yet succeeded, but since I have only been programming for 2 weeks, I don't think this will be trouble for some of you season pro's.</p>
  
  <hr>
  
  <p>This is what I have tried as requested, I thinks its faaar off but at least I tried.</p>
  
  <pre><code>            if (Title.Contains("Foo") == true &amp;&amp; Regex.IsMatch(Title, "^Foo") == true)
          {
              CheckAnd = true;
          }
          else if (Title.Contains("Foo") == true &amp;&amp; Regex.IsMatch(Title, "^Foo") == false)
          {
              CheckAnd = false;
          }
          else if (Regex.IsMatch(Title, "^foo"))
          {
              CheckAnd = false;
          }
          else
          {
              CheckAnd = true;
          }
  </code></pre>
  
  <hr>
  
  <p>Ok guys, nearly there, this is what I got from all your answers:</p>
  
  <pre><code>if (Title.IndexOf("Foo") == 0 &amp;&amp; Title.LastIndexOf("Foo") == 0)
          {
              CheckAnd = true;
          }
          else if (Title.LastIndexOf("Foo") &gt; 0)
          {
              CheckAnd = false;
          }
          else if(Title.Contains("foo") &amp;&amp; Title.StartsWith("Foo") == false &amp;&amp; PUT CHECK HERE)
  </code></pre>
  
  <p>The last thing I need to check that all occurrences of foo are lowercase in the last else if statement ?</p>