为什么"ELSE:"在vb.net中编译?

use*_*753 7 vb.net operators

为什么编译?

If Months > 1 Then

    Label.Text = Months + " Months"

Else : Months = 1

    Label.Text = Months + " Month"

End If
Run Code Online (Sandbox Code Playgroud)

使用Visual Studio 2010.

Ry-*_*Ry- 12

:是行分隔符.它等同于换行符:

If Months > 1 Then

    Label.Text = Months + " Months"

Else

    Months = 1
    Label.Text = Months + " Month"

End If
Run Code Online (Sandbox Code Playgroud)

这是我能找到的最好的文档.抱歉.