From: Adam Prescott Date: 2012-01-31T01:39:03+09:00 Subject: [ruby-core:42271] Re: Fwd: RCR String#{last, first} --14dae9399e05e7b3e204b7c17b8a Content-Type: text/plain; charset=UTF-8 On Mon, Jan 30, 2012 at 16:27, Roger Pack wrote: > Hmm. I was thinking "first" and "last" would be good since they would > match Array#last and Array#first but maybe something like first_chars > or something? > For #first, since String#chars returns an enumerator, you can currently get away with str.chars.first(10). But since Enumerator#last doesn't exist, perhaps that's argument enough for having #{first,last}_chars. --14dae9399e05e7b3e204b7c17b8a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Jan 30, 2012 at 16:27, Roger Pack <rogerdpack2@gmail.= com> wrote:
Hmm. =C2=A0I was thinking "first" and "last= " would be good since they would
match Array#last and Array#first but maybe something like first_chars
or something?

For #first, since Strin= g#chars returns an enumerator, you can currently get away with str.chars.fi= rst(10). But since Enumerator#last doesn't exist, perhaps that's ar= gument enough for having #{first,last}_chars.
--14dae9399e05e7b3e204b7c17b8a--