|
capitalizing variables for display
I'm sure this is something simple, but as I'm a bit new to regular expressions, it's giving me a headache.
what i want to do is take a character string of varying lengths of words and capitalize every word.. i have so far suceeded in taking of the first letter and lowercasing the rest as follows:
$brand =~ s/\w//;
$brand =~ tr/A-Z/a-z/;
and i assume there must be some way to put the first character in another variable and capitalize it, then put them back together.. but most likely i'm going about it all wrong. Can anyone tell me the easy way to do this?
thanks, jesse
|