SubString

The Substring() function returns a subset of a text.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

WEM functions are 1-based where it concerns position parameters: 1 is the first position.

Syntax

Substring(text,length)

If only the length parameter is provided, the result will be taken from the first character of the text-value.

Substring("Important", 6) => "Import"

Substring("Important", 16) => "Important"

Substring(text,start_position,length)

If start_position is specifically provided, the result will be taken from the indicated starting position with the understanding that position 1 is the first character. If 0 (zero) is used as start_position, it will also use the first character to start from.

Substring("Important", 3, 4) => "port"

Substring("Important", 1, 2) => "Im"

Substring("Important", 0, 2) => "Im"

Substring("Important", 4, 16) => "ortant"

Parameters

Name
Type
Required
Description

text

text

☑️

a text

start_position

numeric

(optional) the position to start from. 1-based, so the first character is start_position 1.

length

numeric

☑️

the number of characters to take from text

Last updated

Was this helpful?