Re: Re(2): Counting Words and Characters
Re: Re(2): Counting Words and Characters
- Subject: Re: Re(2): Counting Words and Characters
- From: Michelle Steiner <email@hidden>
- Date: Fri, 13 Jul 2001 10:41:32 -0700
On 7/13/01 10:15 AM, Arthur Cormack <email@hidden> wrote:
>
Thank you Michelle.
>
It looks like this will work ... if you know what
>
>wordtochange
>
(if you know that it is "jumped", for example) is.
>
If you don't know what the word is(??????), and do know what word
>
number (~word 5 of stringtochange) it is in the line, is there any
>
way of figuring out what that word's offset is?
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
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------