Passing string value after apply split function in asp.net c# -


i have fail pass string value label or text box after split function. question how store string value in label after applying split function.

string strdata2 = "samsung,apple,htc";        char[] separator2 = new char[] { ',' }; string[] strsplitarr = strdata2.split(separator2); foreach (string arrstr in strsplitarr) {        response.write(arrstr + "<br/>");  } 

(e.g. label.text = ""+ the split string value ) thanks

you can use string.join:

label.text = string.join("," , strsplitarr); 

concatenates elements of string array, using specified separator between each element.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -