Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# join array

using System.Linq;

namespace Program
{
    public class Program
    {
      string[] cLangs = { "Langs","C", "C++", "C#" };
      // String join will just join the array with a comma and a whitespace
      // Using Linq, the skip method will skip x (called count in the parameter) number elements you tell it to
      Console.WriteLine(string.Join(", ", cLangs.Skip(1).ToArray())); // Output: C, C++, C#
    }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #join #array
ADD COMMENT
Topic
Name
3+3 =