日期:2014-05-17  浏览次数:20767 次

字符串.split的问题
有一个字符串
m="a='111' and b='222' and ccc>200"
现在想实现
var tmp=m.split(" and "); // tmp结果是 {"a='111'","b='222'","ccc>200"}
貌似C#中split参数不能是一个字符串,有没有替代的方法啊?

------解决方案--------------------
 string m = "a='111' and b='222' and ccc>200";
            var ary = m.Split(new string[] { "and" }, StringSplitOptions.RemoveEmptyEntries);
           
------解决方案--------------------
var tmp=Regex.split(m," and "); 
------解决方案--------------------
s.Split(new string[] { "and" }, StringSplitOptions.RemoveEmptyEntries);