Jul. 18th, 2013

nonethefewer: A steampunk heart, from here: http://www.girlgeniusonline.com/comic.php?date=20050926 (geeky)
Goddammit. I could do this in Python in two seconds, but C# is thwarting me.

In Python:

countryInfo = {
	'Australia': {
		'id': '13',
		'pre': '61',
		'len': '9'
	},
	'Spain': {
		'id': '207',
		'pre': '34',
		'len': '9'
	}
}
country = "Spain"
print "The prefix for %s is %s" % (country, countryInfo[country]["pre"])


Output:

The prefix for Spain is 34


But how do I do this well in C#?

ExpandContext. )

Expand[eta] Current implementation. )
Page generated Jul. 20th, 2025 10:59 am
Powered by Dreamwidth Studios