c# - How to split words in ASP.NET MVC4? -


how split words in asp.net mvc4?

this try far.

public actionresult index()         {             var aaa = system.text.regularexpressions.regex.split("12:::34:::55", ":::");              viewbag.test = aaa;             return view();         } 

but page shows system.string[].

you seeing string representation of array.

to show elements, use string.join:

viewbag.test = string.join(",", //insert separator here                            aaa); 

this return "12,34,55".

if want have separate lines, replace "," environment.newline. can have spaces " ", or other separator of choice.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -