• 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: Accessing lasts characters of a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing lasts characters of a string


  • Subject: Re: Accessing lasts characters of a string
  • From: "Mark J. Reed" <email@hidden>
  • Date: Wed, 12 Mar 2008 18:19:14 -0400

Which is why, despite the pleasant Lispiness of "rest of", I prefer
"text 2 through end". Actually, even in Lisp you'd most likely use
sequence ops (subseq) instead of converting to a list and using list
ops (rest/cdr),


On 3/12/08, Luther Fuller <email@hidden> wrote:
> On Mar 12, 2008, at 4:19 PM, Michelle Steiner wrote:
>
> > On Mar 12, 2008, at 2:02 PM, Luther Fuller wrote:
> >
> >>> property strA : "abcdefghijklmnopqrstuvwxyz"
> >>> set strB to (rest of characters of strA) as text
> >>> set strC to (rest of characters of strB) as text
> >>> log strC
> >>
> >> No, like this ...
> >>
> >> property strA : "abcdefghijklmnopqrstuvwxyz"
> >> set AppleScript's text item delimiters to {""}
> >> set strB to (rest of characters of strA) as text
> >> set strC to (rest of characters of strB) as text
> >> log strC
> >>
> >> Setting TIDs to null is NOT optional!
> >
> > If you're addressing characters, text item delimiters doesn't come
> > into play.  The only time you would have to set text item
> > delimiters is if you're addressing text items, which you're not in
> > this situation.  It is not only not optional; it is not needed.
>
> No.
> 'characters of strA' is a list, the list of characters or single
> character text items in strA.
> (rest of characters of strA) is also a list.
> '(rest of characters of strA) as text' is text where each text item,
> in this case a character, is separated by the TID.
>
> Run the script above with this small change and you will see what
> happens:
>
> set AppleScript's text item delimiters to {"#"}
>
>  _______________________________________________
> 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
>


--
Mark J. Reed <email@hidden>
 _______________________________________________
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: 
 >Accessing lasts characters of a string (From: Jean Létourneau <email@hidden>)
 >Re: Accessing lasts characters of a string (From: Luther Fuller <email@hidden>)
 >Re: Accessing lasts characters of a string (From: Luther Fuller <email@hidden>)
 >Re: Accessing lasts characters of a string (From: Michelle Steiner <email@hidden>)
 >Re: Accessing lasts characters of a string (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Accessing lasts characters of a string
  • Next by Date: Re: Accessing lasts characters of a string
  • Previous by thread: Re: Accessing lasts characters of a string
  • Next by thread: Re: Accessing lasts characters of a string
  • Index(es):
    • Date
    • Thread