how to get each item without using a loop from string array in c# -


iam using 3 string arrays.i want each item corresponds index,ie if itnme have second item,then need second item other 2 string arrays such qntity,price.how can possible this?

    string[] itmnme= new string[0] { };     string[] price= new string[0] { };     string[] qntity= new string[0] { }; foreach (string iname in itmnme)   {     foreach (string qnt in qntity)       {         foreach (string prc in price)           {           }       }   } 

assuming size of arrays identical can use such code:

for(int i=0; i<itmnme.length; i++) {     var name = itmnme[i];     var quantity = qntity[i];     var price = price[i];     // need these values } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -