Split string by comma using C# - ASP TANMOY

Latest

Friday 28 April 2017

Split string by comma using C#

PROGRAM
===================================

class Program
{
    static void Main()
    {
        string s = "Website Design, Website Development, E-Commerce Website";
        // Split string on spaces.
        // ... This will separate all the words.
        string[] words = s.Split(',');
        foreach (string word in words)
        {
            Console.WriteLine(word);
        }
    }
}


======================================

OUTPUT

Website Design
Website Development
E-Commerce Website

No comments:

Post a Comment