How to repeatedly remove such strings "aa, bb, cc, dd, aa, bb, cc, dd" into "aa, bb, cc, dd"
It's very difficult, I hope the experts will help me, thank you
In "aa, bb, cc, dd, aa, bb, cc, dd", go to the string before the first "," and loop to find the next one, and replace "aa," or "aa" with "", you will get a new string, repeat the above, find the next
string a="aa,bb,cc,dd,aa,bb,cc,dd";
string[] strs=a.Split(',');
Hashtable ht=new Hashtable();
foreach(string str in strs)
if(!ht.Contains(str))
ht.Add(str,"");
string strRen="";
IDictionaryEnumerator ide=ht.GetEnumerator();
ide.Reset();
while(ide.MoveNext())
{
strRen+=(string)ide.Key+",";
}//Give you a fun way to write