Function
GLibutf8_substring
since: 2.30
Declaration [src]
gchar*
g_utf8_substring(
constgchar*str,
glongstart_pos,
glongend_pos
)
Description [src]
Copies a substring out of a UTF-8 encoded string.
The substring will contain end_pos - start_pos characters.
Since GLib 2.72, -1 can be passed to end_pos to indicate the
end of the string.
Available since: 2.30
Parameters
str-
Type:
const gchar*A UTF-8 encoded string.
The data is owned by the caller of the function.The value is a NUL terminated UTF-8 string. start_pos-
Type:
glongA character offset within
str. end_pos-
Type:
glongAnother character offset within
str, or-1to indicate the end of the string.
Return value
Type: gchar*
A newly allocated copy of the requested
substring. Free with g_free() when no longer needed.
The caller of the function takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.