GLib.Variant.new_string
Description: Reference for GLib.Variant.new_string

### Function

# GLib Variantnew_string

since: 2.24

#### Declaration

    GVariant*
    g_variant_new_string (
      const gchar* string
    )

#### Description

Creates a string `GVariant` with the contents of `string`.

`string` must be valid UTF-8, and must not be `NULL`. To encode potentially-`NULL` strings, use `g_variant_new()` with `ms` as the [format string][gvariant-format-strings-maybe-types].

Available since: 2.24

#### Parameters

`string`

  Type: `const gchar*`

  A normal UTF-8 nul-terminated string.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

#### Return value

Type: `GVariant`

A floating reference to a new string `GVariant` instance.

The data is owned by the called function.