private string noSameStr(string str)
{
str = "|"+str;
string[] strs = str.Split('|');
for(int i=0;i {
if(strs[i].Trim() != "")
{
if(str.Replace("|"+strs[i].Trim()+"|","").Length != str.Length-strs[i].Length)
{
str = str.Replace("|"+strs[i].Trim()+"|","|") + "|"+ strs[i].Trim() + "|";
}
}
}
string nosame = "|";
strs = str.Split('|');
for(int i=0;i {
if(strs[i].Trim() != "")
{
nosame += strs[i].Trim() +"|";
}
}
return nosame;
}
<>
<>
{
str = "|"+str;
string[] strs = str.Split('|');
for(int i=0;i
if(strs[i].Trim() != "")
{
if(str.Replace("|"+strs[i].Trim()+"|","").Length != str.Length-strs[i].Length)
{
str = str.Replace("|"+strs[i].Trim()+"|","|") + "|"+ strs[i].Trim() + "|";
}
}
}
string nosame = "|";
strs = str.Split('|');
for(int i=0;i
if(strs[i].Trim() != "")
{
nosame += strs[i].Trim() +"|";
}
}
return nosame;
}
关键字词: