-1
這是我的代碼的Visual Basic。載有()空異常
Dim words(0) As String
Dim trie As String
Dim temp As String
For i = 1 To 26
trie = encrypt(a, -i)
Console.WriteLine(trie)
For j = 0 To words.Length - 1
temp = words(j)
If trie.Contains(temp) Then
Console.ReadLine()
End If
Next
Next
應該檢查是否線索包含數組的話任何項目,但它拋出一個異常NULL
。
encrypt(a, -i)
只是改變字符串
細節的缺乏。什麼是'了'? –
什麼是例外? –
['String.Contains'](https://msdn.microsoft.com/de-de/library/dy85x1sa(v = vs.110).aspx)如果傳遞的參數是空引用,則會引發'ArgumentNullException'。所以你必須檢查它:'如果溫度不是Nothing並且trie.Contains(temp)Then ...' –