Function

GLibutf8_strrchr

Declaration

gchar*
g_utf8_strrchr (
  const gchar* p,
  gssize len,
  gunichar c
)

Description

Find the rightmost occurrence of the given Unicode character in a UTF-8 encoded string, while limiting the search to len bytes. If len is -1, allow unbounded search.

Parameters

p

Type: const gchar*

A nul-terminated UTF-8 encoded string.

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

Type: gssize

The maximum length of p.

c

Type: gunichar

A Unicode character.

Return value

Type: gchar*

NULL if the string does not contain the character, otherwise, a pointer to the start of the rightmost occurrence of the character in the string.

The data is owned by the called function.
The return value can be NULL.
The value is a NUL terminated UTF-8 string.