c# - how would you remove the blank entry from array -
how remove blank item array?
iterate , assign non-blank items new array?
string test = "john, jane"; //without using test.replace(" ", ""); string[] tolist = test.split(',', ' ', ';');
use overload of string.split
takes stringsplitoptions
:
string[] tolist = test.split(new []{',', ' ', ';'}, stringsplitoptions.removeemptyentries);
Comments
Post a Comment