### Function

# Gimp utf8_strtrim

#### Declaration [src]

    gchar*
    gimp_utf8_strtrim (
      const gchar* str,
      gint max_chars
    )

#### Description [src]

Creates a (possibly trimmed) copy of `str`. The string is cut if it exceeds `max_chars` characters or on the first newline. The fact that the string was trimmed is indicated by appending an ellipsis.

#### Parameters

`str` | `const gchar*`
| An UTF-8 encoded string (or `NULL`)
| The argument can be `NULL`.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`max_chars` | `gint`
| The maximum number of characters before the string get trimmed.

#### Return value

Returns: | `gchar*`
| A (possibly trimmed) copy of `str` which should be freed using `g_free()` when it is not needed any longer.
| 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.