Concat strings by & and + in VB.Net

后端 未结 8 914
萌比男神i
萌比男神i 2020-12-16 10:53

Is there any difference between & and + operators while concatenating string? if yes, then what is difference? And if No, then why below code generating exception?

8条回答
  •  自闭症患者
    2020-12-16 11:25

    Try this. It almost seemed to simple to be right. Simply convert the Integer to a string. Then you can use the method below or concatenate.

    Dim I, J, K, L As Integer
    Dim K1, L1 As String
    
    K1 = K
    L1 = L
    Cells(2, 1) = K1 & " - uploaded"
    Cells(3, 1) = L1 & " - expanded"
    
    MsgBox "records uploaded " & K & " records expanded " & L
    

提交回复
热议问题