《Microsoft Visual C# .NET 2003开发技巧大全》源代码
源代码在线查看: 3.6.txt
Listing 3.6 Performing a Case-Insensitive String Comparison
using System;
namespace _5_CaseComparison
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string str1 = “This Is A String.”;
string str2 = “This is a string.”;
Console.WriteLine( “Case sensitive comparison of” +
“ str1 and str2 = {0}”, String.Compare( str1, str2 ));
Console.WriteLine( “Case insensitive comparison of” +
“ str1 and str2 = {0}”, String.Compare( str1, str2, true ));
}
}
}