• 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(2): Re(2): Counting Words and Characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re(2): Re(2): Counting Words and Characters


  • Subject: Re(2): Re(2): Counting Words and Characters
  • From: "Arthur Cormack" <email@hidden>
  • Date: Fri, 13 Jul 2001 13:50:04 -0400

Thank you Michele. This too will work, even if you don't know what
word number 5 is.
(... it's pretty obvious actually)
... but if the pattern was not unique in the line being analysed -
say, if word 5 also occurred earlier, or later on in the line ... it
could cause some trouble, no? if word 1 was the same as word 5, for
example, and we looked for the offset, we snip in the wrong place.
Am I being too stubborn?

... many convoluted thanks,

-arthur

email@hidden writes:
>set stringtochange to "The quick brown fox jumped over the dirty
>black
>dog's head."
>set wordtochange to word 5 of stringtochange
>set newword to "leaped"
>set beforesnip to (offset of wordtochange in stringtochange) - 1
>set wordlength to length of wordtochange
>set aftersnip to beforesnip + wordlength + 1
>set newstring to text 1 through beforesnip of stringtochange &
>newword &
>text aftersnip through -1 of stringtochange


  • Follow-Ups:
    • Re: Re(2): Re(2): Counting Words and Characters
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: Re(2): Counting Words and Characters (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Re(2): Counting Words and Characters
  • Next by Date: Re: Re(2): Re(2): Counting Words and Characters
  • Previous by thread: Re: Re(2): Counting Words and Characters
  • Next by thread: Re: Re(2): Re(2): Counting Words and Characters
  • Index(es):
    • Date
    • Thread