I have a Dictionary with some key-value pairs stored in it. My problem is that in my dictionary, I have a blank space at the start of the key name, so for accessing the value, I have to use:
Pair[" Key"];
Is there any method where I can remove the starting whitespace, so I can access the value like:
Pair["Key"]
Trimming your string is enough. Besides that you can also write a custom key comparer for your dictionary instead of trimming your string everytime you add or get something to/from your dictionary.