Single statement across multiple lines in VB.NET without the underscore character

后端 未结 8 541
死守一世寂寞
死守一世寂寞 2020-12-09 07:42

Is there a way to have a statement across multiple lines without the underscore character?

It is really annoying in multi-line strings such as SQL statements, and es

8条回答
  •  -上瘾入骨i
    2020-12-09 08:01

    You can use XML literals to sort of do this:

    Dim s = 
      Create table article
      (articleID int  -- sql comment
      ,articleName varchar(50)  
      )
    .Value
    

    warning: XML text rules apply, like & for ampersand, < for <, etc.

    Dim alertText = "Hello World"
    Dim js = .ToString  'instead of .Value includes "

提交回复
热议问题