2017-09-26 188 views
0

對於需要使該功能有效的副項目。基本上我需要的是Concat的字符串從列表返回(串),我需要Concat的每個字符串以編程方式添加string.concat

For Each art As String In artikli 

Next 

'This part below should be programatically changed String.Concat() 
Dim QueryString As String = String.Concat(query, ";", query2, ";", query3, ";", query4) 

每個「藝術」「Artikli」是一個字符串(查詢)。

可以有任意數量的字符串 'Artikli'

回答

0

這應該工作:

Dim QueryString As String = String.Join(";", artikli) 
0

另一種方式

Dim artikli() As String = {"Test 1", "Test 2", "Test 3"} 
    Dim QueryString As String = "" 
    For Each art As String In artikli 
     QueryString += String.Concat(art, ";") 
    Next