+ Start a Discussion

is there two-dimensional array string in apex ?


  Im using  webservice to connect to .NET then im passing an array of records to the .net for that im planing to pass through the 2-dimensional array string, but im getting errors while declaring the 2-d array strings.


IS there any possibility to do this please guide me,


Thank you,




You need to put a list of strings inside a list of 'list of strings',


List<List<String>> listOfListOfStrings = new List<List<String>>();


Then for each inside list, create and populate..

List<String> list1 = new List<String>();





Then put this completed list in the outer one



Do the same for lists 2, 3 and onwards


Hope this is what you were after 


Thanks for your reply,

     I have tried your code its working fine in sales force but when im returning list<list<string>> and when its called from the C#.NET its taking as a single array string but not as 2-d array string. 

I want to store the result in 2-d array string in .NET


Thank you,