From 2cb6c2778134575e425cd5d1bdef036100a25d0d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 22 Sep 2015 19:10:03 +0900 Subject: String#index should no longer take integer argument --- mrblib/string.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrblib/string.rb') diff --git a/mrblib/string.rb b/mrblib/string.rb index 5765cff9b..7209f03d2 100644 --- a/mrblib/string.rb +++ b/mrblib/string.rb @@ -12,7 +12,7 @@ class String def each_line(&block) # expect that str.index accepts an Integer for 1st argument as a byte data offset = 0 - while pos = self.index(0x0a, offset) + while pos = self.index("\n", offset) block.call(self[offset, pos + 1 - offset]) offset = pos + 1 end -- cgit v1.2.3