c# 以换行(\r\n)拆分字符串

时间:2016-06-17 19:21:55   收藏:0   阅读:2104

c# 以换行(\r\n)拆分字符串

字符串数组形式:

string[] striparr = strip.Split(new string[] { "\r\n" }, StringSplitOptions.None);

striparr = striparr.Where(s => !string.IsNullOrEmpty(s)).ToArray();

List<sting>形式:

List<string> striparr = strip.Split(new string[] { "\r\n" }, StringSplitOptions.None).ToList();
striparr = striparr.Where(s => !string.IsNullOrEmpty(s)).ToList();

 

原文:http://www.cnblogs.com/zhangtingzu/p/5594764.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!