[#107430] [Ruby master Feature#18566] Merge `io-wait` gem into core IO — "byroot (Jean Boussier)" <noreply@...>
Issue #18566 has been reported by byroot (Jean Boussier).
22 messages
2022/02/02
[ruby-core:107429] [Ruby master Feature#13110] Byte-based operations for String
From:
"shugo (Shugo Maeda)" <noreply@...>
Date:
2022-02-02 07:10:29 UTC
List:
ruby-core #107429
Issue #13110 has been updated by shugo (Shugo Maeda). Assignee set to matz (Yukihiro Matsumoto) Status changed from Open to Assigned I've created a pull request which adds String#byteindex, String#byterindex, and MatchData#byteoffset: https://github.com/ruby/ruby/pull/5518 ---------------------------------------- Feature #13110: Byte-based operations for String https://bugs.ruby-lang.org/issues/13110#change-96328 * 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: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>