I am using VS2013 and .NET FrameWork 4.0.
I am building an app that reads a json file and acts upon it.
I have successfully written the code to deserialize the json file and I have a list(of String) which I would like to join in a single string.
This is my code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim g As GameData = Nothing
Using fileStream = New System.IO.FileStream("C:\Users\KE-KL\Desktop\Levels\level_0017.json", System.IO.FileMode.Open)
fileStream.Position = 0
Dim ser = New System.Runtime.Serialization.Json.DataContractJsonSerializer(GetType(GameData))
g = DirectCast(ser.ReadObject(fileStream), GameData)
End Using
Dim final As String
final = String.Join(",", g.board.tiles.ToArray)
End Sub
But this line:final = String.Join(",", g.board.tiles.ToArray)
creates this error:
Error 1 Overload resolution failed because no accessible 'Join' is most specific for these arguments: 'Public Shared Function Join(Of System.Collections.Generic.List(Of String))(separator As String, values As System.Collections.Generic.IEnumerable(Of System.Collections.Generic.List(Of String))) As String': Not most specific. 'Public Shared Function Join(separator As String, ParamArray values() As Object) As String': Not most specific
Any idea how to fix this? If you need more details, please do ask. Thank you in advance