[#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:107639] [Ruby master Feature#13110] Byte-based operations for String
From:
"austin (Austin Ziegler)" <noreply@...>
Date:
2022-02-17 15:22:31 UTC
List:
ruby-core #107639
Issue #13110 has been updated by austin (Austin Ziegler). matz (Yukihiro Matsumoto) wrote in #note-24: > Regarding names, I accept `byteindex`, `byterindex`, `byteoffset`. > I am against `byte_rindex` since I consider the naming consistency is more important. This could be opened as a new issue, but would it be possible to consider adding more readable aliases as suggested by Shugo in #note-22 with the idea that for Ruby 4.0, the non-underscored versions would be removed? That is, add `byte_slice`, `get_byte`, `set_byte`, etc. in 3.2; mark `byteslice` &c. as deprecated in 3.4, and eventually remove `byteslice` &c. in 4.0? ---------------------------------------- Feature #13110: Byte-based operations for String https://bugs.ruby-lang.org/issues/13110#change-96551 * 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>