utf8Substring

fun utf8Substring(str: String, startPos: <Error class: unknown class>, endPos: <Error class: unknown class>): String

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.

Return

a newly allocated copy of the requested substring. Free with g_free() when no longer needed.

Since

2.30

Parameters

str

a UTF-8 encoded string

startPos

a character offset within @str

endPos

another character offset within @str, or -1 to indicate the end of the string