Skip to content
Snippets Groups Projects
  • Jonathan Schöbel's avatar
    bacd41a4
    Text: fetch range · bacd41a4
    Jonathan Schöbel authored
    The function SH_Text_get_range returns a string begining at start and
    ending at end. Note that end specifies the char, that is not returned
    anymore. Thus the function implements something similar, as the pythonic
    slice syntax (text[start:end]). In opposition to the behaviour there,
    calling SH_Text_get_range with start > end is undefined behaviour. If
    start == end, the empty string is returned.
    If start is out of bounds, NULL is returned and an error is set. If end
    is out of bounds, the existent part is returned. Also the length of the
    returned string can be set (optionally) to the out parameter length.
    bacd41a4
    History
    Text: fetch range
    Jonathan Schöbel authored
    The function SH_Text_get_range returns a string begining at start and
    ending at end. Note that end specifies the char, that is not returned
    anymore. Thus the function implements something similar, as the pythonic
    slice syntax (text[start:end]). In opposition to the behaviour there,
    calling SH_Text_get_range with start > end is undefined behaviour. If
    start == end, the empty string is returned.
    If start is out of bounds, NULL is returned and an error is set. If end
    is out of bounds, the existent part is returned. Also the length of the
    returned string can be set (optionally) to the out parameter length.