Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Best way to remove the last character from a string?

From: antonr:lexicon at: 15-Dec-2004 0:47

These compete with Method 2:
>> copy/part mystring ((length? mystring) - 1)
== "12345"
>> copy/part mystring skip tail mystring -1
== "12345"
>> copy/part mystring at tail mystring -1
== "12345" to save you five characters. :) I admit this always makes me think there must be a better way, apart from making your own function. Anton.