From: "shugo (Shugo Maeda)" Date: 2022-02-03T06:54:03+00:00 Subject: [ruby-core:107455] [Ruby master Feature#13110] Byte-based operations for String Issue #13110 has been updated by shugo (Shugo Maeda). Personally I prefer byterindex because it's a C-like name (I guess String#rindex came from rindex(3)). However, I follow Matz's decision. ---------------------------------------- Feature #13110: Byte-based operations for String https://bugs.ruby-lang.org/issues/13110#change-96358 * Author: shugo (Shugo Maeda) * Status: Assigned * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- How about to add byte-based operations for String? ```ruby s = "���������������������������" p s.byteindex(/������/, 4) #=> 18 x, y = Regexp.last_match.byteoffset(0) #=> [18, 24] s.bytesplice(x...y, "���������") p s #=> "������������������������������" ``` ---Files-------------------------------- byteindex.diff (2.83 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: