Q:

how to replace dbk,depb,epcg,nfei with Demo[i]?

here is my code i want to replace dbk,depb,epcg,nfei with Demo[i]
        string Test = ddlExim.SelectedItem.Text.Substring(3);
        txtEximDesc.Text = ddlExim.SelectedItem.Text.Substring(3);
        string[] Demo = ddlExim.SelectedValue.Split(',');

            DBK.Style.Add("display", "none");
            DEPB.Style.Add("display", "none");
            EPCG.Style.Add("display", "none");
            NFEI.Style.Add("display", "none");
            for (int i = 0; i < 3; i++)
            {
                if (Demo[i] == "DEPB")
                {
                    DEPB.Style.Add("display", "table-row");
                }
            }
        }

A:

If I understand your problem correctly then I think the simplest way would be adding a switch case. Check the code below. Please elaborate your question if this is not what you meant.
        for (int i = 0; i < Demo.Length; i++)
        {
            switch (Demo[i].ToLower())
            {
                case"dbk":
                    DBK.Style.Add("display", "table-row");
                    break;

                    //And so on

                default:
                    break;
            }
        }

OR
mark runat="server" to the table element inside which these tablerows are present ("tbl" in my example) and then try the following code.
    for (int i = 0; i < Demo.Length; i++)
    {
        (tbl.FindControl(Demo[i]) as HtmlTableRow).Style.Add("display", "table-row");
    }

Of course you need to add the following namespace.
    using System.Web.UI.HtmlControls;

Hope this helps.

