[#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:107452] [Ruby master Feature#13110] Byte-based operations for String
From:
"shugo (Shugo Maeda)" <noreply@...>
Date:
2022-02-02 23:14:15 UTC
List:
ruby-core #107452
Issue #13110 has been updated by shugo (Shugo Maeda). Eregon (Benoit Daloze) wrote in #note-21: > I think it should be `byte_index`, `byte_rindex` and `byte_offset`. > I know there is `String#byteslice`/`getbyte`/`setbyte`, but `byterindex` starts to be really hard to read to the point it doesn't look like a proper Ruby method name to me. > `byte_index`, `byte_rindex` and `byte_offset` seem much clearer. Yes, byterindex may be hard to read. If we choose byte_*, it may be good to introduce aliases like byte_slice for existing methods. What do you think, Matz? ---------------------------------------- Feature #13110: Byte-based operations for String https://bugs.ruby-lang.org/issues/13110#change-96356 * 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>