CF Quick Tip: Lower case structure keys

Recently I needed to return a JSON representation of a ColdFusion structure, but I needed one of the Key's to be all lower case. I knew that CF natively uppercase's Key names, but figured there had to be a way to change this.

It turns out that you can make the key value all lower case, or even mixed case, the trick is to enter it like a named array element. Here's an example:

Example Dump:

Heck, try it for yourself, I have whipped up a simple example page: Lowercase Structure Keys Example

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.