FwupdPlugin.strsplit
Description: Reference for FwupdPlugin.strsplit

### Function

# FwupdPluginstrsplit

since: 1.8.2

#### Declaration [src]

    gchar**
    fu_strsplit (
      const gchar* str,
      gsize sz,
      const gchar* delimiter,
      gint max_tokens
    )

#### Description [src]

Splits a string into a maximum of `max_tokens` pieces, using the given delimiter. If `max_tokens` is reached, the remainder of string is appended to the last token.

Available since: 1.8.2

#### Parameters

`str`

  Type: `const gchar*`

  A string to split.

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

`sz`

  Type: `gsize`

  Size of `str`, which must be more than 0

`delimiter`

  Type: `const gchar*`

  A string which specifies the places at which to split the string.

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

`max_tokens`

  Type: `gint`

  The maximum number of pieces to split `str` into.

#### Return value

Type: An array of `utf8`

A newly-allocated NULL-terminated array of strings.

The array is `NULL`-terminated.
The caller of the function takes ownership of the data, and is responsible for freeing it.
Each element is a NUL terminated UTF-8 string.