Append
Appends a value to the builder.
Module: Std
Signature
rux
func Append(self, c: char8);
func Append(self, str: char8[]);
func Append(self, str: String);Parameters
| Name | Type | Description |
|---|---|---|
c | char8 | A single byte to append. |
str | char8[] / String | A literal, slice, or string to append. |
Description
Appends the argument to the end of the builder, growing the buffer if needed. The overloads let you mix single characters, string literals, slices, and String values without converting between them. Appending an empty slice or string is a no-op.
Example
rux
import Std::StringBuilder;
import Std::String;
var sb = StringBuilder::New();
sb.Append("count: "); // char8[]
sb.Append(c8'#'); // char8
sb.Append(String::From("42"));// String
// "count: #42"See also
StringBuilder— the typeReserve— pre-grow before many appendsIntoString— finish and take the result