vb.net – VB中的“_ _”是什么意思?

前端之家收集整理的这篇文章主要介绍了vb.net – VB中的“_ _”是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我将一些来自旧版VB应用程序的查询语句复制到C#应用程序.我不熟悉VB,虽然看着它让我想要一个VB(维多利亚苦涩).我遇到了像这样构建的查询
*SELECT dp_duckbill_accounts.platypus_no AS duckbill,t_accounts.name AS Name " & _ 
"FROM t_accounts INNER JOIN dp_duckbill_accounts ON  t_accounts.account_no = dp_duckbill_accounts.account_no " & _
"ORDER BY dp_duckbill_accounts.platypus_no*

“& _”让我暂停.如果只是“&”我会认为它对应于“”在C#连接字符串.但是,世界上哪一个是下划线呢?注意&符号和下划线用空格分隔.

下划线是 line continuation character.它允许连接包括不同的线.像这样:
x = "Hello " & "World"

x = "Hello " & _
    "World"

'this won't compile (pre vb.net 2010,anyway)
    x = "Hello " & 
    "World"

Line Continuation on MSDN

How to: Break and Combine Statements in Code (Visual Basic)

猜你在找的VB相关文章