There maybe another way but you could always check the ASCII values.
Lowercase and UPPERCASE have different values.
However checking this for each letter in a TEXTAREA is quite a bit.
Sure there is another way.. Hopefully someone has an easy answer.
-Original Message-
From: Saturday
refind([a-z], text) is 0
Looks to find the first lowercase letter. If none are found, it returns 0.
Of course, it won't help you find things like
i HAVE MY CAPS LOCK ON BY MISTAKE, sTUART!
--Ben
Saturday (Stuart Kidd) wrote:
Hi guys,
Just wondering if anyone knows a good way to recognise
Just wondering if anyone knows a good way to recognise
when all the characters are capitalised? Some users
love putting text in CAPS and it just looks awful when
it's displayed on screen.
Ben's regexp should work, or you can compare...
cfif str is uCase(str)
is all caps
/cfif
cfset theWord = form.UserInput /
cfif compare(form.UserInput, ucase(form.UserInput)) EQ 0 -- word is all caps
might be able to build on that?
On 10/24/05, Adkins, Randy [EMAIL PROTECTED] wrote:
There maybe another way but you could always check the ASCII values.
Lowercase and UPPERCASE have
uppercase (ucasecount) than lowercase (lcasecount)
characters found. you might be SHOUTING.);
}
/cfscript
-Original Message-
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: 24 October 2005 19:12
To: CF-Talk
Subject: Re: stop: SHOUTING
cfset theWord = form.UserInput /
cfif compare
(lcasecount)
characters found. you might be SHOUTING.);
}
/cfscript
-Original Message-
From: Kerry [mailto:[EMAIL PROTECTED]
Sent: 24 October 2005 19:19
To: CF-Talk
Subject: RE: stop: SHOUTING
what about comparing number of uppercase characters to number of lowercase?
cfscript
str=i HAVE MY
Thanks to everyone for their help on this.
Via everyone's help i've now got a solution.
:)
On 24 Oct 2005, at 19:28, Kerry wrote:
cfscript
str=i HAVE MY CAPS LOCK ON BY MISTAKE!;
ucasecount = len(rereplace(str,[^A-Z],,ALL));
lcasecount = len(rereplace(str,[^a-z],,ALL));
if(ucasecount gt
7 matches
Mail list logo