From: Ruohao Li Date: 2010-08-26T22:47:36+09:00 Subject: [ruby-core:31856] Re: [Bug #3747] Possible bug of String#count? --001517511476354b4a048eba38f8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In the documentation of String#count, "Any _other_str_ that starts with a caret (^) is negated". Thus s.count("^a") means the number of characters that is *not* a, which should be 1. On Thu, Aug 26, 2010 at 9:41 PM, Marcus R=C3=BCckert wrote: > Issue #3747 has been updated by Marcus R=C3=BCckert. > > > didnt you want to say: > $ puts s.count("a") > 1 > > if you do: > $ s =3D "^a\u3042" > $ puts s.count("^a") > 1 > > > ---------------------------------------- > http://redmine.ruby-lang.org/issues/show/3747 > > ---------------------------------------- > http://redmine.ruby-lang.org > > --001517511476354b4a048eba38f8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In the documentation of String#count, "Any _other_str_ that starts wit= h a caret (^) is negated". Thus s.count("^a") means the numb= er of characters that is *not* a, which should be 1.

On Thu, Aug 26, 2010 at 9:41 PM, Marcus R=C3=BCckert <= redmine@ruby-lang.org> wrote:
Issue #3747 has been updated by Marcus R=C3=BCckert.


didnt you want to say:
$ puts s.count("a")
1

if you do:
$ s =3D "^a\u3042"
$ puts s.count("^a")
1


----------------------------------------
----------------------------------------

--001517511476354b4a048eba38f8--