用C#写的输出字符串中出现过的所有字符,相同字符只输出一次
string str = "AAABBCCCC";
string strI = str[0].ToString();
string strChild = str[0].ToString();
for (int i = 0; i < str.Length; i++)
{
if (strI != str[i].ToString())
{
strI = str[i].ToString();
strChild += str[i].ToString();
}
}
Response.Write(strChild);