Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Capitalize variable

edited January 2014 in Help! with 1.x
Hello, I've tried checking the wiki and the google group, but no joy.  Basically, I'd like to know if there's an easy way of capitalising a variable, so that when it prints it prints with the first letter capitalised.  For instance, if I have a variable called $colour which is set to 'blue', but I want to print it at the beginning of a sentence it would show as 'Blue'.  I understand this can be done in javascript or CSS, but was wondering if there was a way to do it via the inbuilt syntax?  If not, could anyone point me in the direction of a scripted version?

Thanks :)

Edit:  Hmm, think I managed to figure it out in the end, but will post here in case there is a better way of doing it (or in case anyone else is interested).
<<print $colour [0].toUpperCase() + $colour .slice(1)>>
seems to do the trick!
Sign In or Register to comment.