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
Post a Comment