Re: Manipulating text
Re: Manipulating text
- Subject: Re: Manipulating text
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 25 Sep 2009 09:57:52 -0400
On Fri, Sep 25, 2009 at 9:35 AM, Luther Fuller <email@hidden> wrote:
> For example ...
> (*
> id of "a" -- 97
> id of "z" -- 122
> id of "A" -- 65
> id of "Z" -- 90
> *)
Not a good way to go in the age of Unicode; completely fails for
accented characters, other alphabets, etc. Need either an osax or an
external app that understands case mappings. Quickie Perl example:
set theText to "OIL_OF_OLÉ"
do shell script "perl -Mencoding=utf8 -lpe
's/(^|[_\\s])([^_\\s]+)/($1?\" \":\"\") . ucfirst(lc($2))/ge' <<<" &
quoted form of theText
--> Oil Of Olé
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden