How To convert 1D array to 2D array in C# -


i have:

string snacks="chocolate,alwa,samosa,channa"; 

i need array like:

snacks= {"chocolate,alwa" , "samosa,channa"}; in c#.

could pls suggest way find snacks

        string snack2[][]=new string[math.round(snacks.length/2)][2];         int cnt=0;         for(int i=0;i<math.round(snacks.length/2);i++)         {              (int j=0;j<2;j++)              {                  snacks2[i][j]=snack[cnt++];              }         } 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -