• 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: Trim space chars from start of line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trim space chars from start of line


  • Subject: Re: Trim space chars from start of line
  • From: "Zavatone, Alex" <email@hidden>
  • Date: Mon, 25 Jul 2011 12:59:10 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Trim space chars from start of line

Yours wins by 1 second. :)  
19 seconds vs 20.
Still need to speed this up, but I'll live with it for now.  Thanks all.

On Jul 25, 2011, at 2:30 PM, KOENIG Yvan wrote:


Le 25 juil. 2011 à 20:10, Zavatone, Alex a écrit :

on TrimSpacesFromStartOfLine(myText)
set myLength to the length of myText
set myChar to character 1 of myText

repeat while (myChar = " ")
if myLength > 1 then
set myText to characters 2 through myLength of myText as string
set myLength to the length of myText
set myChar to character 1 of myText
else
set myText to ""
set myChar to ""
end if
end repeat

return myText
end TrimSpacesFromStartOfLine


Here is my stripped version

on TrimSpacesFromStartOfLine(myText)

repeat while (first character of myText = " ")
if myText > space then
set myText to characters 2 through -1 of myText as string
else
set myText to ""
exit repeat
end if
end repeat

return myText
end TrimSpacesFromStartOfLine

my TrimSpacesFromStartOfLine("      just for see.")

Yvan KOENIG (VALLAURIS, France) lundi 25 juillet 2011 21:29:39


<ATT00001..txt>

This email message and any attachments are for the sole use of the intended recipient(s) and may contain information that is proprietary to U.S. Foodservice, Inc and/or its subsidiaries or otherwise confidential or legally privileged. If you have received this message in error, please notify the sender by reply, and delete all copies of this message and any attachments. If you are the intended recipient you may use the information contained in this message and any files attached to this message only as authorized by U.S. Foodservice. Files attached to this message may only be transmitted using secure systems and appropriate means of encryption, and must be secured using the same level password and security protection with which the file was provided to you. Any unauthorized use, dissemination or disclosure of this message or it's attachments is strictly prohibited.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Trim space chars from start of line
      • From: Stan Cleveland <email@hidden>
References: 
 >Trim space chars from start of line (From: "Zavatone, Alex" <email@hidden>)
 >Re: Trim space chars from start of line (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: I know this is not the right place to ask this buuut.
  • Next by Date: Re: Trim space chars from start of line
  • Previous by thread: Re: Trim space chars from start of line
  • Next by thread: Re: Trim space chars from start of line
  • Index(es):
    • Date
    • Thread