ASP.net VB字符串生成器双双引号

时间:2018-09-18 09:40:43

标签: asp.net vb.net stringbuilder

对此我一直在转圈。每次我尝试使用单个双引号字符构建此字符串时,看起来它都连续添加了两个双引号字符,因此我最终使用双双引号。我在做什么错了?

这是我的代码:

Dim sb As New StringBuilder
sb.Append("[")
For i As Integer = 0 To datMemberlist.Rows.Count - 1
    sb.Append("""")
    sb.Append(datMemberlist.Rows(i).Item("Name"))
    sb.Append("""" & ", ")
Next
strUsers = sb.ToString.Remove(sb.ToString.Length - 2, 2)
strUsers = strUsers & "]"

我期望"["FirstName LastName", "FirstName LastName"]",但是我得到"[""FirstName LastName"", ""FirstName LastName""]"

0 个答案:

没有答案