Skip to main content

SLICE

Return a substring of the value from a start offset to an end offset

Example Usage

SLICE("ABC123", 0, 2) -> "AB"
SLICE("ABC123", 2, 4) -> "C1"
SLICE("ABC123", 1, ) -> "BC123"
SLICE("ABC123", , 4) -> "ABC12"
SLICE("ABC123", -1, ) -> "3"
SLICE("ABC123", -2, ) -> "23"
SLICE("ABC123", , -1) -> "ABC12"
SLICE("ABC123", , -2) -> "ABC1"

Overview

Function signature
SLICE(value, start, end)

Category
String

Return data type
string

Arguments

NameDataTypeList Options                          Description
valuestringThe source value to slice
startintThe start offset of the substring; if omitted it starts at the beginning; if negative it starts backwards from the end
endintThe end offset of the substring; if omitted the slice toes to the end; if negative it counts backwards from the end