I have list of string in which I am adding location and its zip code dynamically,
and I am populating that list in text box with scroll bar. But I get space between location and zip code depending on location length,
for example :
Chicago 60016
Niles 12332
San Francisco 95858
What I want is
Chicago 60016
Niles 12332
San Francisco 95858
Here is my code :
var List<string> CityZip = new List<string>();
foreach(var item in CollectionofCityZip)
{
CityZip.Add(item.City + " " + item.Zip);
}
Update
I tried CityZip.Add(item.City.PadRight(14) + item.Zip);
It gave me :
Chicago 60016
Niles 12332
San Francisco 95858
But I want
Chicago 60016
Niles 12332
San Francisco 95858