C#中split的方法汇总(StringSplitOptions.RemoveEmptyEntries)

 

js:

 var arr = str.substring(0, useranswer.length - 1).split(",");

c#:

  var str="sfsdfs,sfd,fs,"
var arr =str.Split(new Char[]{','}, StringSplitOptions.RemoveEmptyEntries);//去除空数据
var arr1=str.Split(",");//保留空数据
 var arr1=str.Split(new Char[]{'a','b'})


posted @ 2019-05-10 16:33  记忆中的梦境  阅读(2997)  评论(0编辑  收藏  举报