Skip to content
FutureBlitz

    Install

    Import std.io.memory

    StringWriter

    std.io.memory

    class

    Public Class StringWriter Implements Writer

    Collects what's written to it, as text, which ToString gives.

    Examples

    Local writer = StringWriter()
    Try Copy(StringReader("copied"), writer)
    Try writer.WriteText(" and added")
    Expect(writer.ToString() == "copied and added")

    std/io/memory.fb, line 138

    • Public New() constructor #

      A new StringWriter, with nothing written.

    • Public Property Count: Int64 property #

      How many bytes it has.

    • Public Method Write(from: Buffer<UInt8>) Throws IOError method #

      Adds from's bytes to what it has. Throws an IOError when it would hold more than 2147483647 bytes.

    • Public Method ToString(): String method #

      What it has, as text, with U+FFFD for each byte that doesn't start well-formed UTF-8.

    Report an issue with this page or with FutureBlitz on GitHub.