Length v0.1.0

Source
Returns how many bytes have been written.

Package: Text

Signature

func Length(self) -> uint;

Returns

The number of bytes written so far, which is not the Capacity — a builder holds a block that is usually bigger than what has been put in it.

The count is in bytes, so a multi-byte UTF-8 sequence counts once per byte.

Example

import Text::StringBuilder;

func Main() -> int {
    var builder = StringBuilder::WithCapacity(64);
    builder.Append("Rux");

    builder.Length();   // 3
    builder.Capacity(); // 64

    builder.Free();
    return 0;
}

See also