If the delimiter character char is present in the string val, this separates the string into pieces. If there are multiple pieces in the string, from and to specify which range of these pieces to return, starting at 1. If multiple pieces are returned, the delimiter in the return string is the same as the delimiter in the input string. For example:
Piece("A,B,C,D,E,F") returns "A"
Piece("A!B!C!D!E!F","!",2,4) returns "B!C!D"
The default char is a comma, the default from is 1, and the default to is from (return one piece). For details, see the $PIECE function in the ObjectScript Reference.