Project

General

Profile

« Previous | Next » 

Revision 16f241f0

Added by byroot (Jean Boussier) 9 months ago

Implement String#append_as_bytes(String | Integer, ...)

[Feature #20594]

A handy method to construct a string out of multiple chunks.

Contrary to String#concat, it doesn't do any encoding negociation,
and simply append the content as bytes regardless of whether this
result in a broken string or not.

It's the caller responsibility to check for String#valid_encoding?
in cases where it's needed.

When passed integers, only the lower byte is considered, like in
String#setbyte.