flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: What's the easiest way to tell if a character is a letter or not?
Date Mon, 22 Apr 2013 14:57:21 GMT



On 4/22/13 3:47 AM, "Harbs" <harbs.lists@gmail.com> wrote:

> A quick test on this seems to work with all characters in the latin range with
> the exception of ß (probably because there's no official capital and
> lowercaseŠ)
My first thought was: 'what about Asia?'

> 
> On Apr 22, 2013, at 1:41 PM, Harbs wrote:
> 
>> What about this:
>> 
>> if(letter.toLowerCase() != letter.toUpperCase()){
>> // do your stuff...
>> }
>> 
>> I have no idea how performance compares to figuring it out yourself thoughŠ
>> 
>> On Apr 22, 2013, at 4:05 AM, Justin Mclean wrote:
>> 
>>> Hi,
>>> 
>>> Anyone know how to work out if a character, including unicode characters, is
>>> a letter or not?
>>> 
>>> This is not the right way of doing it:
>>> 
>>>           if ("a" <= letter && letter <= "z" ||
>>>               "A" <= letter && letter <= "Z")
>>> 
>>> From the DateFormatter class for the curious.
>>> 
>>> Thanks,
>>> Justin
>>> 
>>> 
>>> 
>> 
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Mime
View raw message