>>and return Not ALpha, Upper or Lower.
It still does not return proper info for international characters.
Since CF is a multilingual application, the least would be the function
to be compatible with
uCase and lCase CF functions and Locale settings.
So I maintain this to be a better solution :
(Note that the function asc() must be use in order to bypass the case
less comparison operators in CF.
<CFSCRIPT>
// checks if parameter is lower case letter (returns -1)
// uppercase letter (returns 1)
// or not a letter (returns 0)
function isUpperLower(ch)
{
var upper = asc(uCase(ch));
if (upper EQ asc(lCase(ch))) return 0;
if (upper EQ asc(ch)) return 1;
return -1;
}
</CFSCRIPT>
It returns:
isUpperLower("a") = -1
isUpperLower("A") = 1
isUpperLower("é") = -1
isUpperLower("É") = 1
isUpperLower("ç") = -1
isUpperLower("Ç") = 1
isUpperLower("ñ") = -1
isUpperLower("Ñ") = 1
isUpperLower("æ") = -1
isUpperLower("Æ") = 1
isUpperLower("1") = 0
isUpperLower("?") = 0
isUpperLower("@") = 0
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:224718
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54