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: greggirwin:mindspring at: 14-Dec-2004 10:40

Peter et al, P> I've worked out two ways to chop-off the last character of a string. .... P> Can anyone suggest a less verbose, clearer and quicker way for me? This is a great topic for general discussion of a CHOP mezzanine! I'm sure a lot of us have them, and different ones for different uses. If we can come up with a good one, then we can propose it to RT for inclusion in REBOL. The trick is that it must be a good, flexible function (IMO). Thoughts: Chop n items from head, tail, or both (default: tail)? Chop at an arbitrary position in the series, or just use AT when you make the call? n can be a number other than one, but default behavior is to chop one item? Should the series be copied, or altered in place? Return the item(s) removed, or should that be a different function (PULL, CUT)? -- Gregg