How to work with comma-separated strings


Hi to all.

In this post we introduce with comma separated strings. how we can work with it and manipulate in our work.

string language= "C#,Java,Php,python;

now we convert it to string array.

string[] languageArray= language.Split(',');
foreach (string slanguage in languageArray)
{
    //code what you want
    //print slanguage
}

We can split comma separated string like this.also we can split any character with split function.

like language.Split('|');

Thanks for read post.

Any problem comment us.


Comments

Popular posts from this blog

Populate combo box for month and year in c#

How to get month days count from date or month and year

CRUD Operations in win form application with access database