String Join Method in c#

Total Post:341

Points:2389
C#  String 
C#
 1288  View(s)
Ratings:
Rate this:
I want to use String Join Method  in c# please help me.
  1. Post:281

    Points:2003
    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();
        }
    }

     

      Modified On Apr-10-2018 06:26:41 AM

Answer

NEWSLETTER

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