请教一个正则表达式 字符串格式为:fhaklahfhasdjfalkdsfl,kasjd要把该字符串分解为3段:第一段为第一行,第二段为第二行的逗号前面的那部分,第三段为逗号后面的部分。请各位高手赐教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用split直接就拆分开了 string delimStr = " ,.:"; char [] delimiter = delimStr.ToCharArray(); string words = "one two,three:four."; string [] split = null;split = words.split(delimiter); 就是有一段文字11111222,33333以上是一个整体,把这个整体分为3部分,第一部分:11111,第二部分:222,第三部分:33333这样。我自己写了一段代码,请指教Regex r=new Regex(@"(\s)\\r\\n(\s)(,)(\s)");string[] temp;temp=r.Split(oneresult);filename = temp[0];fileurl = temp[1];filesize = temp[2];结果却分不开,不知哪里写错了 "用split直接就拆分开了 string delimStr = " ,.:"; char [] delimiter = delimStr.ToCharArray(); string words = "one two,three:four."; string [] split = null;split = words.split(delimiter);"学习... string[] array = str.Replace("\r\n", ",").Trim ().Split(new char[] { ',' }); 如果可能有多个换行,可以用正则..str="你的字符串";Regex rx = new Regex(@"(\r\n)+");string[] array = rx.Replace(str, ",").Trim ().Split(new char[] { ',' }); 收到后来用“,”替换\r\n,再用“,”split,就ok了 如何在使用母版页的网站中使用第三方组件? 问一下动态创建DataList的问题. jQuery选择文本并对超过字符剪切。。 怎么让GridView和数据库绑定? 如何让aspx 的页面从纸张的顶端开始打印? table显示保持问题? grove 如何连接 oracle 一个有趣的加密与机密问题,看你是否能做出来!! >>>求助<<< 有没有好一点的介绍在ASP.NET(C#)中使用存储过程的例子,或书? 高手救命!!!200份捐赠!!! 一个一直没有解决的问题 请教.net中的数据验证控件问题
char [] delimiter = delimStr.ToCharArray();
string words = "one two,three:four.";
string [] split = null;
split = words.split(delimiter);
222,33333以上是一个整体,把这个整体分为3部分,第一部分:11111,第二部分:222,第三部分:33333这样。我自己写了一段代码,请指教Regex r=new Regex(@"(\s)\\r\\n(\s)(,)(\s)");
string[] temp;
temp=r.Split(oneresult);
filename = temp[0];
fileurl = temp[1];
filesize = temp[2];结果却分不开,不知哪里写错了
用split直接就拆分开了 string delimStr = " ,.:";
char [] delimiter = delimStr.ToCharArray();
string words = "one two,three:four.";
string [] split = null;
split = words.split(delimiter);
"
学习...
Regex rx = new Regex(@"(\r\n)+");
string[] array = rx.Replace(str, ",").Trim ().Split(new char[] { ',' });