C#分割字符串

using System.Text.RegularExpressions;

e.g. 除去字符串"Hi, Boy. This is a test. said by Boyson, two months ago."中的字符串"Boyson"

            String test = "Hi, Boy. This is a test. said by Boysome, two months ago";
            String ss = "Boysome";
            string[] sArray = Regex.Split(test, "Boysome");

            foreach (string i in sArray)
               Console.Write(i.ToString() );

posted on 2009-04-25 23:22  terancs  阅读(385)  评论(0编辑  收藏  举报

导航