/** * Breaks a camelCased string into separate words * 8-mar-2010 added option to capitalize parsed words Brian Meloche brianmeloche@gmail.com * * @param str String to use (Required) * @param capitalize Boolean to return capitalized words (Optional) * @return Returns a string * @author Richard (acdhirr@trilobiet.nl) * @version 0, March 8, 2010 */ function camelToSpace(str) { var rtnStr=lcase(reReplace(arguments.str,"([A-Z])([a-z])"," \1\2","ALL")); if (arrayLen(arguments) GT 1 AND arguments[2] EQ true) { rtnStr=reReplace(arguments.str,"([a-z])([A-Z])","\1 \2","ALL"); rtnStr=uCase(left(rtnStr,1)) & right(rtnStr,len(rtnStr)-1); } return trim(rtnStr); }