• 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: counting w*rds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: counting w*rds


  • Subject: Re: counting w*rds
  • From: Dennis Wurster <email@hidden>
  • Date: Tue, 22 May 2001 16:55:11 -0400

On 5/22/2001 1:03 AM, Ehsan Saffari (email@hidden) wrote:

>There are many characters that AS considers a word:
>
>set x to "****"
>count words of x -->4
>
>how can I count the words in a string while
>ignoring a special character like "*" using vanilla AS:
>
>set x to "****"
>count words of x -->me needs 1

Isn't there a way to tokenize the string, having each word be a token?
then just count the tokens.
>
>and on a similar note, how to count the occurances of a substring in a
>string?

I'd use a RegEx osax and develop a regular expression. Or, for vanilla
AS, leverage the power of BBEdit, which can do the regex searching for
you with its grep search.

-=Dennis=-

------------------------
Dennis Wurster
Senior IT Specialist
Infantino Associates


  • Prev by Date: Installer Observer Substitute, or an applescript workaround
  • Next by Date: Tell Finder Make New Folder wierdness!
  • Previous by thread: counting w*rds
  • Next by thread: Re: counting w*rds
  • Index(es):
    • Date
    • Thread