Proper Case

This is the quickest way to get Proper Case in ASP/VBScript code that I’m aware of. Had need of it today, figured I’d stick it here, too. Just insert it at the top of your page, and Poof. Function available.

<script language=jscript runat=server>
function toTitleJscript(str) {
        return str.replace(/\s[a-z]/g, function (str, n) { return str.toUpperCase(); });
}
</script>

And for kicks, here’s the similar Capitalize version:

<script language=jscript runat=server>
function toCapsJscript(str) {
        return str.replace(/\b[a-z]/g, function (str, n) { return str.toUpperCase(); });
}
</script>

Sweat and Moonlight

I went for a lunch-time walk while at work today – just a short 20 minute trip. It’s still warm enough that I sweat when I’m doing anything outdoors. What’s the point of trying to do something healthy if it only makes you uncomfortable later? Blech.

Sepia toned moonlight glowed through the misty darkness of my drive home Wednesday.
As the past-full-moon sailed higher, brighter, the roadside mist subsided,
But for a while, the drive through Lenawee was prettier while only dimly lit.