• 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
need something faster
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

need something faster


  • Subject: need something faster
  • From: Hudson Barton <email@hidden>
  • Date: Sat, 4 Jun 2005 07:49:18 -0400

What the following handler does is clean up a text string that contains unwanted characters and formats the result with regular line endings. It is way too slow when processing a long string. Any suggestions?


H.


on cleanup(dirtytext)
set i to 1
set ct to length of dirtytext
set cleantext to ""
set r to 1
repeat with i from 1 to ct
if character i of dirtytext is in "ABCDEF1234567890" then
set cleantext to cleantext & (character i of dirtytext) as string
set i to (i + 1)
if r = 40 then
set cleantext to (cleantext & (ascii character 10)) as string
set r to 1
else
set r to (r + 1)
end if
end if
end repeat
if last character of cleantext is not (ascii character 10) then set cleantext to cleantext & (ascii character 10)


	return cleantext
end cleanup
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: need something faster
      • From: kai <email@hidden>
    • Re: need something faster
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: More weird Unicode things
  • Next by Date: Mail (delete aged msgs) scpt
  • Previous by thread: HP Scanning made a bit easier?
  • Next by thread: Re: need something faster
  • Index(es):
    • Date
    • Thread