Re(2): Counting Words and Characters
Re(2): Counting Words and Characters
- Subject: Re(2): Counting Words and Characters
- From: "Arthur Cormack" <email@hidden>
- Date: Fri, 13 Jul 2001 13:15:51 -0400
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?
Regards,
And many thanks.
Arthur
email@hidden writes:
>
set stringtochange to "The quick brown fox jumped over the dirty
>
black
>
dog's head."
>
set wordtochange to "jumped"
>
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