Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to concat values of item and item1 in the list above :

public ActionResult Indexx()
      {
          using (db)
          {
              FieldInfo[] mytables =      db.GetType().GetFields(BindingFlags.Public |
                                     BindingFlags.NonPublic |
                                     BindingFlags.Instance);
 
              List<string> tbllistname = new List<string>();
              string[] proinfo = new string[] { " CREATE ", " READ  " , " EDIT  " , " DELETE  " };
 
 
              foreach (var item in mytables)
              {
                  foreach (var item1 in proinfo)
                  {
 
                      tbllistname.Add(item.Name.Split('<', '>')[1]); //CONCAT ITEM1
                      
                  }
                  
              }
              ViewBag.MyTables = tbllistname;
          }
          return View();
      }


What I have tried:

000000000000000000000000000000000
Posted
Updated 27-Dec-17 0:16am
Comments
Karthik_Mahalingam 27-Dec-17 6:10am    
what is your expected output?

1 solution

try

tbllistname.Add(item.Name.Split('<', '>')[1] + " " + item1 );
 
Share this answer
 
v2
Comments
ddgjgj 27-Dec-17 6:18am    
HOLY GRAIL.THANKS MILION TIMES
Karthik_Mahalingam 27-Dec-17 6:27am    
welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900