• 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: silly newbie question #42
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: silly newbie question #42


  • Subject: Re: silly newbie question #42
  • From: Peter Matthias Noordzij <email@hidden>
  • Date: Wed, 10 Apr 2002 20:52:38 +0200

02/04/10 17:47, Natalie Lambert wrote:


> set cityName as "St Louis"
> --find space, remove space
> set result as newCityName
>
> help?

--begin script
removeSpace("St Louis")

on removeSpace(TestWord)
set theResult to ""
repeat with i from 1 to the number of characters of TestWord
if (ASCII number (character i of TestWord))  32 then
set theResult to theResult & character i of TestWord
end if
end repeat
return theResult
end removeSpace
--end script

Actually, the script does search look for spaces. It tests the ASCII
value of each character, and if it is 32 (space character) it will be
discarded.


Matthias

* * *

Peter Matthias Noordzij Waaldijk 77 5327 AB Hurwenen
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: silly newbie question #42
      • From: Peter Matthias Noordzij <email@hidden>
References: 
 >silly newbie question #42 (From: Natalie Lambert <email@hidden>)

  • Prev by Date: RE: silly newbie question
  • Next by Date: Re: silly newbie question #42
  • Previous by thread: Re: silly newbie question #42
  • Next by thread: Re: silly newbie question #42
  • Index(es):
    • Date
    • Thread