Issue #14033 has been updated by ioquatix (Samuel Williams).


I would like to propose to extend this method to be binary safe.

If the destination string uses `Encoding::BINARY`, the append operation should be a memcpy which doesn't affect the receiver's encoding.

----------------------------------------
Feature #14033: Add String#append
https://bugs.ruby-lang.org/issues/14033#change-73362

* Author: sos4nt (Stefan Schler)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Ruby 2.5 introduces `Array#append` as an alias for `<<` / `push`.

Likewise, there should be `String#append` as an alias for `<<` / `concat`. The documentation for `<<` even says "append":

> Appendˇ˝Concatenates the given object to str. [...]

And `String` already has a `prepend` method.



-- 
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>