Loader.fromString

Construct a Loader to load YAML from a string.

  1. Loader fromString(char[] data)
    struct Loader
    static @safe
    fromString
    (
    char[] data
    )
  2. Loader fromString(string data)

Return Value

Type: Loader

Loader loading YAML from given string.

Throws

YAMLException if data could not be read (e.g. a decoding error)

Examples

Load a char[].

assert(Loader.fromString("42".dup).load().as!int == 42);

Load a string.

assert(Loader.fromString("42").load().as!int == 42);

Meta