Function

GLib-2.0GLibutf8_truncate_middleSince 2.78

  • Cuts off the middle of the string, preserving half of truncate_length characters at the beginning and half at the end.

    If string is already short enough, this returns a copy of string. If truncate_length is 0, an empty string is returned.

    Parameters

    • string: string

      a nul-terminated UTF-8 encoded string

    • truncate_length: number

      the new size of string, in characters, including the ellipsis character

    Returns string

    a newly-allocated copy of string ellipsized in the middle

    2.78