I'm doing a school project and I'm struggling to sort my "Fruit" array. The values are all inputted from the user and that's all fine but every time I try and use Array.Sort
I get this error:
NulllReferenceException was unhandled...
Can you help me sort my array with minimal coding?
Dim fruit_value As String = Fruit_Box.Text
Fruit(Fruit_counter) = fruit_value
Fruit_counter += 1
MessageBox.Show("Data has been entered")
For i = 0 To Fruit_counter - 1
' Array.Sort(Fruit) doesn't work here due to error coming from code below:
Fruit_contents = Fruit_contents & (Fruit(i)).ToString & " | "
Next
MessageBox.Show(Fruit_contents)