Larry Steinle

October 9, 2013

JavaScript Hash Array (Dictionary)

Filed under: Web — Larry Steinle @ 10:15 pm
Tags: , , ,

A hash array (aka dictionary) stores a value in memory that is accessible using a key name. I like using hash arrays to store the key/value pairs found in an URL’s query string. JavaScript comes with a standard indexed array but lacks a hash array. Lucky for us creating a hash array is a very simple and useful exercise in JavaScript.
(more…)

Advertisement

January 25, 2011

Extending IEnumerable

Filed under: VS.Net — Larry Steinle @ 11:57 pm
Tags: , , , , , , , ,

Often there is the need to take a string value and split it into an array of values. String.Split provides a quick and convenient method to split strings (as long as you don’t have to worry about text qualifiers). Today I ran into the opposite scenario. I needed to combine the different iterations of an array into a single string value.

Immediately my mind turned to extensions. A beautiful, simple and elegant solution.
(more…)

Blog at WordPress.com.