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);
精彩评论