• 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: KOENIG Yvan <email@hidden>
  • Date: Mon, 25 Jul 2011 21:30:40 +0200


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


 _______________________________________________
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: Deivy Petrescu <email@hidden>
    • Re: Trim space chars from start of line
      • From: "Zavatone, Alex" <email@hidden>
References: 
 >Trim space chars from start of line (From: "Zavatone, Alex" <email@hidden>)

  • Prev by Date: Re: Lion Sucks?
  • Next by Date: Re: Lion Sucks?
  • 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