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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -