コード例 #1
0
            public int Compare(object a, object b)
            {
                string x         = ConvertUtility.Trim(a);
                string y         = ConvertUtility.Trim(b);
                string character = "abcdefghijklmnopqrstuvwxyz";

                if (!string.IsNullOrEmpty(x))
                {
                    x = x.Replace("室", string.Empty);
                }
                if (!string.IsNullOrEmpty(y))
                {
                    y = y.Replace("室", string.Empty);
                }
                int a_int = 0;
                int b_int = 0;

                if (character.IndexOf(x.ToLower()) > -1)
                {
                    a_int = ConvertUtility.ToASCIICode(x.ToLower());
                }
                else
                {
                    a_int = ConvertUtility.ToInt(x);
                }
                if (character.IndexOf(y.ToLower()) > -1)
                {
                    b_int = ConvertUtility.ToASCIICode(y.ToLower());
                }
                else
                {
                    b_int = ConvertUtility.ToInt(y);
                }
                return(a_int - b_int);
            }