### Method

# GObject Value steal_string

since: 2.80

#### Declaration

    gchar*
    g_value_steal_string (
      GValue* value
    )

#### Description

Steal ownership on contents of a `G_TYPE_STRING` `GValue`. As a result of this operation the value’s contents will be reset to `NULL`.

The purpose of this call is to provide a way to avoid an extra copy when some object have been serialized into string through `GValue` API.

NOTE: for safety and compatibility purposes, if `GValue` contains static string, or an interned one, this function will return a copy of the string. Otherwise the transfer notation would be ambiguous.

Available since: 2.80

#### Return value

Type: `gchar*`

String content of `value`; Should be freed with `g_free()` when no longer needed.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The return value can be `NULL`.
The value is a NUL terminated UTF-8 string.