string.Join的用法!
//功能:去除掉"a,b-,cde,!,q,wcdes+-976"中的",+-!",重新组成一个数字符串;如:"abcdeqwcdes976" ;
//字符串分割;将"a,b-,cde,!,q,wcdes+-976";
string str = "a,b-,cde,!,q,wcdes+-976";
string[] strArr = str.Split(new char[] { ',', '-', '!', '+' }, StringSplitOptions.RemoveEmptyEntries);
string str1 = null;
for (int i = 0; i < strArr.Length; i++)
{
str1 += strArr[i];
}
string str2 = null;
char[] chs = str1.ToCharArray();
////输出: abcdeqwcdes976
str1 = string.Join("+", chs);
Console.WriteLine(str1);
//输出: a + b + c + d + e + q + w + c + d + e + s + 9 + 7 + 6