怎么比较字符串是忽略大小写

如何比较字符串是忽略大小写?using Systemusing System.Collections.Genericusing System.ComponentMode

如何比较字符串是忽略大小写?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
#region 吴新强于2013年4月10日10:55:03 桂电 2507
#endregion
namespace Compares
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 比较字符串是忽略大小写
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            if(string.Compare(textBox1 .Text .ToLower (),textBox2.Text.ToLower())<0)
            MessageBox.Show ("字符串1小于字符串2","信息",MessageBoxButtons.OK,MessageBoxIcon.Information );

            if (string.Compare(textBox1.Text.ToLower(), textBox2.Text.ToLower()) == 0)
                MessageBox.Show("字符串1等于字符串2", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (string.Compare(textBox1.Text.ToLower(), textBox2.Text.ToLower()) > 0)
                MessageBox.Show("字符串1大于字符串2", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
}

 

怎么比较字符串是忽略大小写