SLICE (return substring from string)

Top  Previous  Next

 

SLICE( expression, start, end )

SLICE

Returns a substring portion of the expression string.

expression

A string constant, symbol, or expression containing the string from which to return a substring portion.

start

An integer constant or symbol containing the starting position (inclusive) within the expression from which to extract the substring.

end

An integer constant or symbol containing the ending position (inclusive) within the expression from which to extract the substring.

The SLICE procedure returns the substring portion of the expression string identified by the start and end position values. This is equivalent to the Clarion language string slicing operation.

Return Data Type:     STRING

Example:

#SET(%MySymbol,SLICE('ABCDE,2,4))       #!Return 'BCD'

 

See Also: Built-In Template Procedures