Gojo
Esc
  • Loading…
strings
Documentation

Standard library

std/strings

Building strings piece by piece.

Types: struct Builder

Types

struct Builder

pub struct Builder {
    // and private fields
}

A growable string buffer: write pieces, then finish to take the String.

Builder.write

pub fn write(inout self, s: str)

Appends s.

Builder.writeRune

pub fn writeRune(inout self, r: rune)

Appends the UTF-8 encoding of r.

Builder.len

pub fn len(self) -> int

The length so far, in bytes.

Builder.finish

pub fn finish(sink self) -> String

The string built (the builder is used up).