首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

字符串.split的有关问题

2013-01-20 
字符串.split的问题有一个字符串ma111 and b222 and ccc200现在想实现var tmpm.split( and )

字符串.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);

热点排行