比如: "good,.bad"     用",."整个字符串作为分割,只产生 good和bad两个字符串

解决方案 »

  1.   

    string str="123,.456,.789";
    string[] arr = str.Split(new char[]{',.'});
    Label1.Text=arr[0].ToString();
      

  2.   

    int i;
    string temp;
    string[] newstr;
    temp="good,.bad";temp=temp.Replace(",.",",");
    newstr=temp.Split(',');for (i=0;i<newstr.Length;i++)
    {
    Console.WriteLine(newstr[i]);
    }
    Console.ReadLine();
      

  3.   

    new Regex( ",\\." ).Split
      

  4.   

    string strLink="head|||will";
    arrLink = strLink.Split("|||".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);