GLib.strchomp
Description: Reference for GLib.strchomp

### Function

# GLibstrchomp

#### Declaration [src]

    gchar*
    g_strchomp (
      gchar* string
    )

#### Description [src]

Removes trailing whitespace from a string.

This function doesn’t allocate or reallocate any memory; it modifies `string` in place. Therefore, it cannot be used on statically allocated strings.

The pointer to `string` is returned to allow the nesting of functions.

Also see `g_strchug()` and `g_strstrip()`.

#### Parameters

`string`

  Type: `gchar*`

  A string to remove the trailing whitespace from.

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

#### Return value

Type: `gchar*`

The modified `string`.

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