IntroductionThis program shows how to convert array of Integers into comma separated string using C#.NET and VB.NET. C#.NET Program:using System;
namespace DotNetMirror
{
class ArrInt2CommaSepVal
{
public static void Main()
{
int[] numbers = new int[5] { 1111, 2222, 3333, 4444, 5555 };
var commasepStr = string.Join(",", numbers);
Console.WriteLine(commasepStr);
Console.ReadLine();
}
}
} VB.NET Program:Namespace DotNetMirror
Class ArrInt2CommaSepVal
Public Shared Sub Main()
Dim numbers As Integer() = New Integer(4) {1111, 2222, 3333, 4444, 5555}
Dim commasepStr = String.Join(",", numbers)
Console.WriteLine(commasepStr)
Console.ReadLine()
End Sub
End Class
End Namespace Output:1111,2222,3333,4444,5555
|