Comparing strings using compareTo() in C#

The example below explains the comparison of two strings.
The comparing result will be in integer.

0 means equals.
1 means not equals.


using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            string name1 = "code";
            string name2 = "code";

            int i =name1.CompareTo(name2);

            Console.WriteLine(i);
                        
        }

    }
}


Output:
0


..