string split函数

  public static string[] MessageSp(string strData, char splitChartemp)
   {
            //2012-3-21修改,增加半角全角字符都可以分隔
            char[] splitChar = new char[2];
            splitChar[0] = splitChartemp;
            splitChar[1] = (char)(splitChar[0] + 65248);
            string[] listMessage = strData.Split(splitChar, StringSplitOptions.RemoveEmptyEntries);
            return listMessage;


            //char[] splitChar = new char[1];
            //splitChar[0] = splitChartemp;
            //string[] listMessage = strData.Split(splitChar, StringSplitOptions.RemoveEmptyEntries);
            //return listMessage;
   }

你可能感兴趣的:(String)