c# - Split array into another array -


i have string array this:

string[] array = new string[3] {"man(21)", "woman(33)", "baby(4)"}; 

now want split array scheme:

array = new string[6] {"man", "21", "woman", "33", "baby", "4"}; 

anybody have idea?

you can use split , selectmany

var result = array.selectmany(x => x.split(new[]     {         '(', ')'     }, stringsplitoptions.removeemptyentries)).toarray(); 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -