blob: c127544960a5b02ed1892a535373aa59867169e2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
using System.Collections.Generic;
namespace com.clusterrr.Famicom.CoolGirl
{
public class ClassicSorter : IComparer<string>
{
public int Compare(string x, string y)
{
int p = 0;
x = x.ToUpper();
y = y.ToUpper();
while (true)
{
if ((p >= x.Length) && (p >= y.Length))
return 0;
else if (p >= x.Length)
return -1;
else if (p >= y.Length)
return 1;
else if (x[p] < y[p])
return -1;
else if (x[p] > y[p])
return 1;
p++;
}
}
}
}
|