Re: Newbie. How do I count "i"?
Re: Newbie. How do I count "i"?
- Subject: Re: Newbie. How do I count "i"?
- From: John W Baxter <email@hidden>
- Date: Sat, 26 Jan 2002 14:16:34 -0800
At 10:46 -0700 1/26/2002, Michelle Steiner wrote:
>
On 1/26/02 3:47 AM, Steen <email@hidden> wrote:
>
>
>Any help with this at will be greatly appreciated.
>
>
there's probably a better way, but this will do it:
>
>
set z to "ideas how to do this?"
>
set text item delimiters to {"i"}
>
set lettercount to (count text items of z) - 1
>
set text item delimiters to {""}
>
lettercount
>
That's probably what I would do (for case sensitive). But...regardless of
method, one's test case should include some double (or longer) i sequences.
And strings with leading and trailing i characters. Encouragingly, the
string "iixyzii" counts to 4 (as it should) using the TID method. But that
one string isn't a full test by any means.
--John
--
John Baxter email@hidden Port Ludlow, WA, USA