Function

GLib-2.0GLibstrrstr_len

  • Searches the string haystack for the last occurrence of the string needle, limiting the length of the search to haystack_len.

    The fact that this function returns gchar * rather than const gchar * is a historical artifact.

    Parameters

    • haystack: string

      a string to search in

    • haystack_len: number

      the maximum length of haystack in bytes. A length of -1 can be used to mean "search the entire string", like GLib.strrstr

    • needle: string

      the string to search for

    Returns string

    a pointer to the found occurrence, or NULL if not found