Convert Dictionary(of int32,int32) to string with ; separator?

i have seen this code,
String.Join(“,”, YourDicitionaryVariable .Select(function (e) e.Key + “:” + e.Value.toString).ToArray)) but this is for dictionary(Of String, Object)
How can i adapt it for Dictionary(of int32,int32)?


Just update Select(function (e) e.Key to Select(function (e) e.Key.ToString and this should work just fine.

Hi @Rowley101
A little modification to above makes it adapt for ur case

String.Join(";",dict1.Select(Function(e) e.Key.ToString+":"+e.Value.ToString))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.