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

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -