Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Manipulate values in dictionary C#

$
0
0

Hi,

    I am trying to figure out a logic to modify the values in dictionary in the following scenario.

I have a dictionary which displays key,value pair of mailing address and the dictionary when debugged looks like

[Address_1,]

[Address_2, 217 test ave]

[Address_3, ]

[Address_4,Dallas tx 43453]

Now i am integrating these values in to a form which has address rows like

Address_1

Address_2

Address_3

Address_4

The service i am working on would integrate the value of address on the form based on the key name(address_1,address_2...). My question is if i have a blank value like for Address_1 & address_3 in dictionary, it is creating blank like on the form as there is no value for address_1 & address_3. So i want to change the dictionary from above to

[Address_1, 217 test ave]

[Address_2,Dallas tx 43453]

[Address_3,]

[Address_4,]

So there won't be any blank lines in between on the form. And it can be in any order like Address_1 can have value and Address_2 need not have any value and so on.


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>