开发者

Can I do this with LINQ?

Can I do this in LINQ, specif开发者_JS百科ically the Split function on the passed in string?

var lstValues = from objValue in value.Split('[')
                where objValue != ""
                select objValue;


Looks fine, but this also looks like you just remove empty entries, you could just use the StringSplitOptions for that:

value.Split(new char[]{'['}, StringSplitOptions.RemoveEmptyEntries);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜