• 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: Michelle Steiner <email@hidden>
  • Date: Mon, 25 Jul 2011 13:47:49 -0700

Hey there, on Mon Jul 25 20:37:02 2011, Zavatone, Alex wrote the following interesting missive:

That will fail on the last character if the whole line is strings. :(

Nice catch.  Here's the fix:

on TrimSpacesFromStartOfLine(myText)
if length of myText > 1 then
repeat while length of myText > 1
if character 1 of myText is " " then
set myText to text 2 through end of myText
else
return myText
exit repeat
end if
end repeat
end if
end TrimSpacesFromStartOfLine

-- Michelle

-- 
"You don't think he's telling the truth, do you?"

"I wouldn't put anything past him."



 _______________________________________________
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

References: 
 >Trim space chars from start of line (From: "Zavatone, Alex" <email@hidden>)
 >Re: Trim space chars from start of line (From: Michelle Steiner <email@hidden>)
 >Re: Trim space chars from start of line (From: "Zavatone, Alex" <email@hidden>)

  • Prev by Date: Re: Trim space chars from start of line
  • 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