I was able to solve my problem with the help of solution1.
this is the required code.
protected void Page_Load(object sender, EventArgs e)
{
string data = "school hostel-cbse,school hostel-icse";
string[] values = data.Split(new char[] { ',' },StringSplitOptions.RemoveEmptyEntries);
foreach(string v in values)
{
Label l = new Label();
l.Text = v;
Panel1.Controls.Add(l);
Panelr1.Controls.Add(new Literal { Text = "<br/>" });
}
}