GLib.StringChunk.insert_len

### Method

# GLib StringChunkinsert_len

since: 2.4

#### Declaration [src]

    gchar*
    g_string_chunk_insert_len (
      GStringChunk* chunk,
      const gchar* string,
      gssize len
    )

#### Description [src]

Adds a copy of the first `len` bytes of `string` to the `GStringChunk`. The copy is nul-terminated.

Since this function does not stop at nul bytes, it is the caller’s responsibility to ensure that `string` has at least `len` addressable bytes.

The characters in the returned string can be changed, if necessary, though you should not change anything after the end of the string.

Available since: 2.4

#### Parameters

`string`

  Type: `const gchar*`

  Bytes to insert.

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

`len`

  Type: `gssize`

  Number of bytes of `string` to insert, or -1 to insert a nul-terminated string.

#### Return value

Type: `gchar*`

A pointer to the copy of `string` within the `GStringChunk`.

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