Imports System
Module Program
Sub WriteConcatenated(ByVal ParamArray TextArr As String())
For I As Integer = 0 To TextArr.Length - 1
For J As Integer = 0 To TextArr.Length - 1
Dim ConcatenatedText = TextArr(I) + TextArr(J)
For Each Text As String In TextArr
If Text = ConcatenatedText Then
Console.WriteLine(Text)
End If
Next
Next
Next
End Sub
Sub Main(args As String())
Console.WriteLine(WriteConcatenated("five", "cents" "twenty", "twentycents"))
Console.ReadLine()
End Sub
End Module
如果有一个由参数数组的其他元素串联形成的元素,我想将它们打印到屏幕上。
例如:上述参数数组中第三个索引的“twentycents”是数组第二个索引处的“twenty”和数组中第一个索引处的“cents”的串联。然后数组的第三个元素将被打印到屏幕上。
就我而言,代码没有错误,但是 Visual Basic 的编译器给了我
BC30491:表达式不产生值
我应该如何纠正这个错误?