title: How are strings terminated in C#?
body: <p>This program throws <code>ArrayIndexOutOfBoundException</code>.</p>
  
  <pre><code>string name = "Naveen";
  int c = 0;
  while( name[ c ] != '\0' ) {
      c++;
  }
  Console.WriteLine("Length of string " + name + " is: " + c);
  </code></pre>
  
  <p>Why is it so?
  If strings are not null-terminated. How strings are getting handled in C#?
  How can I get the length without using <code>string.Length</code> property?
  I'm confused here.!</p>