UCSubstring (open)
Returns part of a UTF-8 string.
Syntax
// Core function, no LOADLIB necessary
STRING FUNCTION UCSubstring(STRING text, INTEGER start, INTEGER numchars)Parameters
STRING textString to return a part from
INTEGER startStarting character (not byte!) position
INTEGER numcharsNumber of characters (not bytes!) to return
Return value
STRINGThe requested part of the string
Description
Substring returns the part of string specified by the start and length parameters.
Examples
// returns 'bcde'
STRING example1 := UCSubstring("abcdef", 1, 4);
// returns '€uro'
STRING example2 := UCSubstring("euro€uro", 4, 4);
// returns '€u'
STRING example3 := Substring("euro€uro", 4, 4);
// returns an empty string
STRING example4 := UCSubstring("abcdef", 100, 100);
// returns an empty string
STRING example5 := UCSubstring("abcdef", -10, -20);