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