Function

GLibutf8_strchr

Declaration

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

Description

Finds the leftmost 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 const gchar*
 

A nul-terminated UTF-8 encoded string.

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

The maximum length of p.

c gunichar
 

A Unicode character.

Return value

Returns: utf8
 

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

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