如何将这整件存储在vb.net中的字符串变量中

时间:2014-01-20 17:12:18

标签: vb.net

" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "

我想将这整个事物添加到一个字符串变量中,我想将它加入另一个字符串!!

1 个答案:

答案 0 :(得分:1)

我不是100%肯定你在这里问的是什么,但要建立一个新的字符串,你将使用这段代码:

Dim FirstName As String = "Bob" 
Dim LastName As String = "Roberts"

'Dim refers to a local variable only accessible within the current type. To make it accessible everywhere, replace 'Dim' with 'Public'

要将字符串连接在一起,您可以使用&运算符或+运算符,但要注意+,因为它有时会尝试将字符串添加到整数(“test”+ 32将在调试时导致错误)。例如:

Dim FullName As String = FirstName & " " & LastName

这行代码将为您提供“Bob Roberts”......

我希望这对你的问题有帮助!

Rodit