//AABB>>AB //AAA>>A //ABBAA>ABA
public static string SpiltString(string str) {
List<char> lstr = new List<char>();
for (int i = 0; i < str.Length; i++)
{ //第一项添加 从第二项开始比较
if (i == 0)
{
lstr.Add(str[i]);
}
else if (str[i] != str[i - 1])
{
lstr.Add(str[i]);
}
}
string st = "";
foreach (char i in lstr)
{
st += i.ToString();
}
return st;
}