Split 获取字符串中指定符号分割的字符内容

 using System.Text.RegularExpressions;


        string strPartners = "24500006B-24450370-24500006";//
        Regex regexSign = new Regex("(-)"); // Split on hyphens.
        string[] partners = regexSign.Split(strPartners);
        if (partners.Length==1)
        {
            Response.Write("");
        }
        else
        {
            for (int i = 0; i < partners.Length; i++)
            {
                if (partners[i].ToString().Equals("-"))
                {
                    continue;
                }
                Response.Write("");
            }
        }

你可能感兴趣的:(.NET)