Project

General

Profile

Actions

Bug #11729

closed

String#split(nil) incorrectly uses $;

Added by tatzyr (Tatsuya Otsuka) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-11-21 trunk 52698) [x86_64-darwin14]
[ruby-dev:49378]

Description

Hi,

Is this intentional?

$; = "@"
"a@b".split(nil) # => ["a", "b"]

I expect ["a@b"] because I found the following sentence in the Japanese documentation.

1 バイトの空白文字 ' ' か nil
先頭と末尾の空白を除いたうえで、空白文字列で分割する。

http://docs.ruby-lang.org/ja/2.2.0/method/String/i/split.html

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0