STRING JOIN METHOD IN C#

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
C#  String 
C#
 798  View(s)
Ratings:
Rate this:
I want to use String Join Method  in c# please help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: String Join Method in c#

    The string.Join method combines many strings into one. It receives two arguments: an array or IEnumerable and a separator string. It places the separator between every element of the collection in the returned string.

    using System;

    class Program
    {
        static void Main()
        {
            string[] arr = { "aditya", "pawan", "pankaj","suresh","sunil","suman","vrijesh","vikash","manoj" };

            Console.WriteLine(string.Join(",", arr));    
            Console.WriteLine(String.Join(",", arr));
            Console.Read();
        }
    }

     

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!