VB.NET 中跨多行的单个语句,不带下划线字符 [英] Single statement across multiple lines in VB.NET without the underscore character
问题描述
有没有办法让语句跨多行而不带下划线字符?
Is there a way to have a statement across multiple lines without the underscore character?
在 SQL 语句等多行字符串中真的很烦人,尤其是 LINQ 查询.
It is really annoying in multi-line strings such as SQL statements, and especially LINQ queries.
除了换行时的丑陋和困难(不再排队),您不能在多行语句中间使用注释.
Beside from the ugliness and difficulty when changing a line (nothing lines up anymore), you can't use comments in the middle of the multi-line statement.
我日常个人地狱的例子.
Examples of my daily personal hell.
dim results = from a in articles _
where a.articleID = 4 _ ' articleID - Nope, can't do this
select a.articleName
dim createArticle as string = _
"Create table article " & _
" (articleID int " & _
" ,articleName varchar(50) " & _
" )"
推荐答案
不,你必须使用下划线,但我相信 VB.NET 10 将允许多行不带下划线,只有在可以的情况下才需要't 弄清楚终点应该在哪里.
No, you have to use the underscore, but I believe that VB.NET 10 will allow multiple lines w/o the underscore, only requiring if it can't figure out where the end should be.
这篇关于VB.NET 中跨多行的单个语句,不带下划线字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!