首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

问个蠢有关问题

2012-01-22 
问个蠢问题PublicClassForm1PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventAr

问个蠢问题
Public   Class   Form1

        Private   Sub   Button1_Click(ByVal   sender   As   System.Object,   ByVal   e   As   System.EventArgs)   Handles   Button1.Click


                TextBox1.Text   =   chl(New   String()   { "1 ",   "2 ",   "3 ",   "4 ",   "5 "})


        End   Sub


        Public   Function   chl(ByVal   s()   As   String)   As   String
                Dim   w   As   String   =   String.Empty
                For   Each   m   As   String   In   s
                        w   +=   m   &   "@ "
                Next
                Return   w
        End   Function

End   Class


为啥参数中可以new   string(),而在外部却不能   dim   x()   as   new   string呢??

[解决办法]
Dim x() As String = New String() { "a ", "b ", "C "}
或者
Dim x As String() = New String() { "a ", "b ", "C "}

热点排行