Just like many problems in computer programming, title casing a string of words seems trivial. We humans do it automatically, but in reality we are appling a complex set of rules. Those rules are codified in the below algorithm, which I originally posted on my personal blog in 2012.