title: Search for a newline Character C#.net
body: <p>How do i search a string for a newline character? Both of the below seem to be returning -1....! </p>
  
  <pre><code> theJ = line.IndexOf(Environment.NewLine);
  </code></pre>
  
  <p>OR</p>
  
  <pre><code> theJ = line.IndexOf('\n');
  </code></pre>
  
  <p>The string it's searching is "yo\n"
  the string i'm parsing contains this "printf("yo\n");" 
  the string i see contained during the comparison is this: "\tprintf(\"yo\n\");"</p>