在C#的字符串操作中,有静态的Compare方法和实例的Compare方法,而Equal是静态方法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CShapeTest
{
class Start
{
static void Main(string[] args)
{
string str1 = "cxm";
string str2 = "zqr";
int result = String.Compare(str1, str2);
Console.WriteLine("{0}", result);
result = str1.CompareTo(str2);
Console.WriteLine("{0}", result);
bool bresult = String.Equals(str1, str2);
Console.WriteLine("{0}", bresult);
Console.ReadLine();
}
}
}