Articles tagged with #string




Negative Substr, Why Must You Plague Me?

Twice over the past few weeks using a negative start value for both String.substr and Array.splice has come back to bite me. So, for the record, if you are use to using: // should return 'bar' 'foobar'.substr(-3); // should return [2,3,4] [0,1,2,3,4 …



Javascript RegExp Match - Named Captures

Anyone who does much javascript development and is familiar with regular expressions knows that javascript is missing one fun little part of regular expression matching, named captures. However without this functionality javascript still works fine, it just returns results from a match in a standard array. For convenience sake it …



Format Names in ColdFusion

I thought I would share a quick bit of code to format names in ColdFusion. Simply all this does is capitalize the first letter of each name part, taking into consideration elements such as hyphens, apostrophes, roman numerals, and nicknames: William "Bill" Doe or William (Bill) Doe. <cffunction name …