なんか、カンマ祭りなので・・・
カンマで区切で出力するプログラムです。
3つの方法がよくあるパターンですかね。
Dim strCsv As String = String.Empty
Dim Data() As Integer = {1, 2, 3}
'①ループ内でカンマ追記判定
For i As Integer = 0 To Data.Length - 1
If i <> 0 Then strCsv &= ","
strCsv &= Data(i)
Next
System.Console.Write(strCsv)
'②ループ後でカンマ除去
For i As Integer = 0 To Data.Length - 1
strCsv &= Data(i) & ","
Next
strCsv = strCsv.Substring(0, strCsv.Length - 1)
System.Console.Write(strCsv)
'③ループ中にカンマ文字列定義
Dim strComma As String = String.Empty
For i As Integer = 0 To Data.Length - 1
strCsv &= strComma & Data(i)
strComma = ","
Next
System.Console.Write(strCsv)