Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maybe real stupid question …



Hi,

Many thanks to all.
"lowercaseString" method of NSString seems to be the way to go.

Takaaki you wrote about an article about ASCII code, where could it be found.

Kind regards
Andreas


The On 24.09.2006, at 20:32, Christopher Nebel wrote:

Well, it's more readable, at any rate, especially if all you need to do is detect an upper (or lower) case letter. To transform between them, using ASCII character/number is the way to go. Of course, both of them only work for ASCII letters -- if you feed them anything with a diacritic mark ("é", for example), they won't work. For a more general solution (but only in Studio), try using the "lowercaseString" method of NSString.


--Chris Nebel AppleScript Engineering

On Sep 24, 2006, at 7:40 AM, Jan Geerling wrote:

Yep, this is better !

Op 24-sep-06 om 16:30 heeft Takaaki Naganoya het volgende geschreven:

How about this code? But you'd better to detect case by ASCII code number
not like this code.


And you'd better to read the article about ASCII code.

http://en.wikipedia.org/wiki/ASCII_code

<AppleScript>
set aChar to "A" --this returns "Upper case"
--set aChar to "a" --this returns "Lower case"
set aRes to detectCase(aChar) of me

on detectCase(aChar)
    considering case
        if aChar is in "abcdefghijklmnopqrstuvwxyz" then
            return "Lower case"
        else if aChar is in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
            return "Upper case"
        else
            return "other characters...."
        end if
    end considering
end detectCase
</AppleScript>

-- Takaaki Naganoya
Piyomaru Software
http://piyo.piyocast.com

On 06.9.24 10:31 PM, "Andreas Kiel" <email@hidden> wrote:

Hi all,

I sitting here and can't find an effective way to figure out whether
a certain character of a text string is either upper or lower.
Any ideas out there?


Thanks for reading the message at all and
kind regards.

Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/maro% 40b-mark.nu


This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/ email@hidden


This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/c.nebel% 40apple.com


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (Applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/ email@hidden


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden
References: 
 >Re: Maybe real stupid question … (From: Takaaki Naganoya <email@hidden>)
 >Re: Maybe real stupid question … (From: Jan Geerling <email@hidden>)
 >Re: Maybe real stupid question … (From: Christopher Nebel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.