Gtk.TextBuffer.prototype.get_slice

function get_slice(start:Gtk.TextIter, end:Gtk.TextIter, include_hidden_chars:Boolean):String {
    // Gjs wrapper for gtk_text_buffer_get_slice()
}

Returns the text in the range [start,end). Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is false. The returned string includes a 0xFFFC character whenever the buffer contains embedded images, so byte and character indexes into the returned string <emphasis>do</emphasis> correspond to byte and character indexes into the buffer. Contrast with Gtk.get_text. Note that 0xFFFC can occur in normal text as well, so it is not a reliable indicator that a pixbuf or widget is in the buffer.

start

start of a range

end

end of a range

include_hidden_chars

whether to include invisible text

Returns

an allocated UTF-8 string