On Sat, 25 Aug 2001, Charles Lu wrote:
> Does anyone know if there is a built in function that allows you to check to
> see if all the characters in a string is capitalized or not? In other words
> is there a way to check to see if a string is capitalized without using
> regular expression? Thanks alot
>
Do you need to know if it's capitalized, or do you just want to make it
capitalized if it isn't?
If you just want to make sure text is capitalized, you can use the
uc() function, or use \U and \E to bracket text.
eg.
$foo = "bar";
uc($foo);
# $foo is now: "BAR"
or
$foo = "bar";
$uc_foo = "\U$foo\E";
# $uc_foo is now: "BAR";
in the latter example, \U starts the capitalization, and \E ends it.
Chris
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]