Function

GLib-2.0GLibutf8_substringSince 2.30

  • Copies a substring out of a UTF-8 encoded string. The substring will contain end_pos - start_pos characters.

    Since GLib 2.72, -1 can be passed to end_pos to indicate the end of the string.

    Parameters

    • str: string

      a UTF-8 encoded string

    • start_pos: number

      a character offset within str

    • end_pos: number

      another character offset within str, or -1 to indicate the end of the string

    Returns string

    a newly allocated copy of the requested substring. Free with GLib.free when no longer needed.

    2.30