• 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: Replacing characters in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing characters in a string


  • Subject: Re: Replacing characters in a string
  • From: Michelle Steiner <email@hidden>
  • Date: Sat, 11 Nov 2000 20:40:54 -0800

On 11/11/00 2:07 PM, Matthew Fischer <email@hidden> wrote:

>How would I change this:
>
> repeat with i from ((length of file_name) - 10) to length of file_name
> if character i of file_name is not ":" then
> set new_file_name to new_file_name & character i of file_name
> end if
> end repeat
>
>To check for multiple characters, instead of just the colon? What I really
>want to do is make sure the character is not a colon, a space or an
>ampersand.

set testArray to {":", "&", " "}
repeat with i from ((length of file_name) - 10) to length of file_name
if character i of file_name is not in testArray then
set new_file_name to new_file_name & character i of file_name
end if
end repeat

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------


  • Prev by Date: Re: Applescvript, Mac OS X, Terminal, PHP and MySQL question
  • Next by Date: stack overflow avoidance?
  • Previous by thread: Re: Replacing characters in a string
  • Next by thread: FM question: Omit in find
  • Index(es):
    • Date
    • Thread