September 2009
4 posts
I am several types of nerd.
function ArrayToSentence(List, Conjunction, OxfordComma) { if (List.length == 0) return ''; if (List.length == 1) return List[0]; if (List.length == 2) OxfordComma = false; var SearchPattern = /^(.*, )?([^,]*)(?:, )([^,]*)$/; var ReplacePattern = OxfordComma ? '$1$2, ## $3' : '$1$2 ## $3'; ReplacePattern = ReplacePattern.replace(/##/, Conjunction); return List.join(',...
Sep 26th
WatchWatch
Sep 24th
Sep 19th
Sep 6th
3 notes