Implement the strcmp(str1, str2) function in c#
<p>I have the following homework problem:</p>

<blockquote>
  <p>There are many ways one can implement the strcmp() function.<br>
  Note that strcmp(str1,str2) returns a negative number if str1 is alphabetically above str2, 0 if both are equal and postiveve if str2
  is alphabetically above str1.</p>
  
  <p>In it can be implemented in C as follows: </p>
</blockquote>

<pre><code>int mystrcmp(const char *s1, const char *s2) 
{ 
    while (*s1==*s2) 
    { 
        if(*s1=='\0') 
           return(0); 
        s1++; 
        s2++; 
    } 
    return(*s1-*s2); 
} 
</code></pre>

<p>So now I want to implement it in C# without using any of the built in methods of .NET. How can I accomplish this?</p>
