I have a list of zones which have following columns:

Zone_id, ZoneName, BuildingName, CityName, RegionName

Now I am converting my list to string as followed:

var result = string.Join(", ", lstOfZones.Select(z => z.RegionName + "->" + z.CityName + "->" + z.BuildingName + "->" + z.ZoneName).ToArray());

and its output is like:

North->New york->Wall Street->JbA,

North->New york->Wall Street->JbB,

South->Chicago->Aqua->HcA,

South->Chicago->Aqua->HcB

But I want output like this:

North->New york->Wall Street->(JbA,JbB),

South->Chicago->Aqua->(HcA,HcB)

Help please?

Related posts

Recent Viewed