Friday, August 22, 2008

Capitalize the first letter of every word in a string

Just a little post for today, I ran into a small situation where I wanted to capitalize the first letter of every word in a string and lowercase all others. There were various ways of doing this on the net, But I never found this way:

REReplaceNoCase(REReplaceNoCase(LCASE("TeSt tHIS sTrInG"),"(^[a-z])","\U\1"),"(\s[a-z])","\U\1")

It seems to work flawlessly and could so easily be turned into a function.

Have fun.

Wednesday, August 13, 2008


The love is strong these days. It's like they read my mind! It's only second to the relationship with my wife..when she's not stressed... and the kid is asleep... and she's gotten her to-do's done... I better stop there. But it's strong, buys, strong.

Two weeks ago I finally post a bug report. (I never do it. I read a lot of posts and forums, but I never [rarely] post issues. I don't know, after this good experience I will more often.) It was for one very annoying firebug *feature* and I got two great responses right away, so fast they were that I wasn't able to follow up on then and testing things until the next day. From these responses I learned that Firebug is not independent-per-tab as I had previously thought, and ignorantly expected. That was the bug report I posted and was quickly schooled on. It is not an independent firebug per tab (as I think it used to be, I may have always been in the dark on that), nor is independent-per-window, as it used to be. It's a single firebug engine. Smart.

Having learned that one fellow openly requested help on how to word this somewhere in the window or in the sites-enabled/disabled pop-up window so that this could be made clear. That's a tough one. Even after I understood I had no apifany for a better solution. ... But I did had a cool idea (and someone read my mind as I thunk it) -- why not make an easy toggle option to turn on/off the firebug engine so, even for enabled sites its only running when you want to use it! Walla, that solves all my problems for gmail in tabs with develpment sites needing firebug. So I submitted that in the bug thread I had submitted along with a good 'thank you' to both smart gentlemen who had responded. The next day one guy responds again to tell me that the latest dev build has that feature. (See, they read my mind! - How do they do it? Wait, I don't want to know, just keep it up, I'll keep thinking engenius thoughts.) The toggle works AWESOME!!!

Then the next dev build (two more days later - that's pretty fast, men!) has the toggle even better (I must have thought it while I was sleeping because I don't remember this one. it must be the hive intelligence). It's got an auto-toggle feature. It works like this: Your on your dev site, firebug is working it's cool jigginess, and you swap to gmail - it auto-toggles off! - you swap back to your dev site, it's still off, but that's okay, the minute I want a peek at the code I click the bug and it's on again showing it's magic!

And that is how the sweet stuff gets sweeter. You gotta love it! Yeah, it's strong.