function convert2DbProp(prop){ var retVal = prop; var prefix = prop.substr(0,prop.search("[A-Z]")) if(''===prefix) { return retVal.toUpperCase(); } else { var suffix = prop.replace(prefix,""); var tempVal = prefix + "_" + suffix.charAt(0).toLowerCase().concat(suffix.substring(1)); return convert2DbProp(tempVal); } }