### Method

# GLib Variant print_string

since: 2.24

#### Declaration [src]

    GString*
    g_variant_print_string (
      GVariant* value,
      GString* string,
      gboolean type_annotate
    )

#### Description [src]

Behaves as g_variant_print(), but operates on a `GString`.

If `string` is non-`NULL` then it is appended to and returned. Else, a new empty `GString` is allocated and it is returned.

Available since: 2.24

This method is not directly available to language bindings.

#### Parameters

`string`

  Type: `GString`

  A `GString`, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`type_annotate`

  Type: `gboolean`

  `TRUE` if type information should be included in the output.

#### Return value

Type: `GString`

A `GString` containing the string.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.