C# 去除Split()中去除内容为空的数据
程序员文章站
2022-04-28 19:46:46
C# 去除Split()中去除内容为空的数据 var str="0001,0002,"; var strusers1 = str.Split(','); ///结果["0001","0002",""] var strusers2 = str.Split(new[] { ',' }, StringSp ......
c# 去除split()中去除内容为空的数据
var str="0001,0002,";
var strusers1 = str.split(','); ///结果["0001","0002",""]
var strusers2 = str.split(new[] { ',' }, stringsplitoptions.removeemptyentries) ///结果["0001","0002",""]
c# 去除split()中内容为空的数据