• 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: stripping an extra character from a text item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stripping an extra character from a text item


  • Subject: Re: stripping an extra character from a text item
  • From: email@hidden
  • Date: Tue, 18 Dec 2001 17:02:37 -0600

At 17:09 -0500 12/18/2001, Mark Martin wrought:

>Try this for stripping unwanted characters:
>
>on Trim(cString)
> set WhiteChars to " "
> set Trimmed to false
> repeat until trimmed
> if character -1 of cString is contained in WhiteChars then
>...
______________________________________________________________________

Not bad 't all, but I still prefer regular expressions.

RegEx Commands Osax: http://www.lazerware.com/FTP/RECommands.hqx

----------------------------------------------------------------------
on rTrim(theString, trimString)
set trimString to "[" & trimString & "]+$"
return REReplace theString pattern trimString with ""
end rTrim

on lTrim(theString, trimString)
set trimString to "^[" & trimString & "]+"
return REReplace theString pattern trimString with ""
end lTrim

set t to " Now is the time! "

set trimedString to rTrim(lTrim(t, " "), " ")
----------------------------------------------------------------------

At 14:22 -0800 12/18/2001, Mark Butcher wrote:
>set extraSpace to "87.54 "
>(word 1 of extraSpace) as real

This actually does work for me with AppleScript 1.6, but I'm not positive that I don't have an osax coercion working in the mix.


Best Regards,

Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden


References: 
 >Re: stripping an extra character from a text item (From: "Mark Martin" <email@hidden>)

  • Prev by Date: RE: Property impermanence
  • Next by Date: RE: In a pickle with simple resize script
  • Previous by thread: Re: stripping an extra character from a text item
  • Next by thread: Re: stripping an extra character from a text item
  • Index(es):
    • Date
    • Thread