From: shugo@... Date: 2017-01-06T16:02:31+00:00 Subject: [ruby-core:78995] [Ruby trunk Bug#13110] Byte-based operations for String Issue #13110 has been reported by Shugo Maeda. ---------------------------------------- Bug #13110: Byte-based operations for String https://bugs.ruby-lang.org/issues/13110 * Author: Shugo Maeda * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- How about to add byte-based operations for String? ``` s = "���������������������������" p s.byteindex(/������/, 4) #=> 18 x, y = Regexp.last_match.byteoffset(0) #=> [18, 24] s.bytesplice(x...y, "���������") p s #=> "������������������������������" ``` -- https://bugs.ruby-lang.org/ Unsubscribe: