如何在msgbox vb.net中传递字符串值

如何在msgbox vb.net中传递字符串值,vb.net,vbscript,Vb.net,Vbscript,我在vb.net和else语句中有一个msgbox。。。。。 我想在其中传递一个字符串值以显示字符串和消息文本,如下所示- Normal msgbox("student is not eligible for the company") TO MSGBOX([string]"is not eligible for the company") RESULT Anthony is not eligible for the company 这方面有什么改进吗 dim

我在vb.net和else语句中有一个msgbox。。。。。 我想在其中传递一个字符串值以显示字符串和消息文本,如下所示-

Normal

    msgbox("student is not eligible for the company")

TO

    MSGBOX([string]"is not eligible for the company")

RESULT

    Anthony is not eligible for the company
这方面有什么改进吗

dim StudentName as string
StudentName = "Student"

If (specificStudent) Then
   StudentName = "SpecificName"
End If

MsgBox(StudentName + " is not eligible")
编辑:也可以在此处使用
string.Format

dim StudentName as string
StudentName = "Student"

If (specificStudent) Then
   StudentName = "SpecificName"
End If

'I suppose string.format works same way in vb.net, as it does in c#    
MsgBox(String.Format("{0} is not eligible", StudentName))
编辑:也可以在此处使用
string.Format

dim StudentName as string
StudentName = "Student"

If (specificStudent) Then
   StudentName = "SpecificName"
End If

'I suppose string.format works same way in vb.net, as it does in c#    
MsgBox(String.Format("{0} is not eligible", StudentName))

@user1897472:添加该选项以给出示例。@user1897472:添加该选项以给出示例。