Dim words() As String = Split(searchString, " ")
Dim wordsCount As Integer = words.Length
Dim index As Integer = 0
Dim addedWords As Integer = 0
Dim holdWords() As String
While addedWords < 5 And index < wordsCount
If Len(words(index)) > 2 Then
addedWords += 1
holdWords(index) = words(index)
End If
index += 1
End While
I get an error when trying to move:
holdWords(index) = words(index)
the contents of one array index into the other,
here is the message:
Object reference not set to an instance of an object.
Line 61: holdWords(index) = words(index)
What am I doing wrong? Thanks
200 points for the answer
Dim wordsCount As Integer = words.Length
Dim index As Integer = 0
Dim addedWords As Integer = 0
Dim holdWords() As String
While addedWords < 5 And index < wordsCount
If Len(words(index)) > 2 Then
addedWords += 1
holdWords(index) = words(index)
End If
index += 1
End While
I get an error when trying to move:
holdWords(index) = words(index)
the contents of one array index into the other,
here is the message:
Object reference not set to an instance of an object.
Line 61: holdWords(index) = words(index)
What am I doing wrong? Thanks
200 points for the answer