chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start par


From: Alex Shinn
Subject: Re: [Chicken-hackers] [PATH] fix for srfi-13 string-trim-right start parameter
Date: Mon, 13 Jan 2014 06:11:32 -0500

On Mon, Jan 13, 2014 at 2:03 AM, John Cowan <address@hidden> wrote:
Alex Shinn scripsit:

> FWIW Mario's interpretation would also require the start argument
> to be used, but in a different way - the trimming would have to be
> restricted to characters after the start:
>
>   (string-trim-right "abc    " char-whitespace? 4) => "abc "

I don't understand that.  Substringing "abc    " to start with
4 produces "     ", which when right-trimmmed becomes "".

The alternate interpretation is that the _action_ (in this
case trimming) is restricted to just the selected part
of the string, but the _result_ is still based on the whole
string.  For example, with casing you would get:

  (string-upcase "abcdefg" 2 5) => "abCDEfg"

-- 
Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]