• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie. How do I count "i"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Newbie. How do I count "i"?
      • From: email@hidden (Michael Sullivan)
  • Prev by Date: Problems with speed & issues with coercion in OS 9.2.2 (AppleScript 1.7)
  • Next by Date: Re: Case handling inconsistency...
  • Previous by thread: Re: Newbie. How do I count "i"?
  • Next by thread: Re: Newbie. How do I count "i"?
  • Index(es):
    • Date
    • Thread