I am trying hard to understand arrays and read around the subject, but much of the literature is not easy to get your head around when you've only just started to program and there's no one you can ask to explain. This is my two dimensional array:
'Declare 2-diensional array of Strings
Dim cars(,) As String =
New String(,) {{"BMW", "Coupe", "Reg:2015", "5 Door"},
{"Ford", "Focus", "Reg:2015", "3 Door"},
{"Land Rover", "Discovery", "Reg:2014", "5 Door"},
{"Vauxhall", "Astra", "Reg:2014", "3 Door"},
{"SEAT", "Ibiza", "Reg:2013", "5 Door"}}
' Get bounds of the array.
Dim bound0 As Integer = cars.GetUpperBound(0)
Dim bound1 As Integer = cars.GetUpperBound(1)
' Loop over all elements.
For i As Integer = 0 To bound0
For x As Integer = 0 To bound1
' Get element.
Dim s1 As String = cars(i, x)
Console.ForegroundColor = ConsoleColor.Green
Console.Write(s1 & ", ")
Next
Console.WriteLine()
Next
Console.ReadKey()
Console.WriteLine("Please enter the name of the record you wish to view")
Dim s = Console.ReadLine()
Dim value As String = Array.Find(cars, Function(x) (x.StartsWith(s)))
Console.WriteLine(value)
Console.ReadKey()
This is the line that is causing the problem
Dim value As String = Array.Find(cars, Function(x) (x.StartsWith(s)))
Visual Studio suggests that the error is because "Data type(s) of the type parameter(s) cannot be inferred from these arguments. Specifying the data type(s) explicitly might correct this error." I cant get my head around what this error means. Please can someone please explain it as though talking to a 10 year old Or perhaps a website that might help me understand this problem. Thanks