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

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();

 

posted on 2018-08-15 15:30  武胜-阿伟  阅读(4996)  评论(1编辑  收藏  举报