Function

GLibstrstr_len

Declaration [src]

gchar*
g_strstr_len (
  const gchar* haystack,
  gssize haystack_len,
  const gchar* needle
)

Description [src]

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

Parameters

haystack const gchar*
 

A nul-terminated string.

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

The maximum length of haystack in bytes. A length of -1 can be used to mean “search the entire string”, like strstr().

needle const gchar*
 

The string to search for.

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

Return value

Returns: gchar*
 

A pointer to the found occurrence, or NULL if not found.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.