textBefore

Modified on Wed, 16 Aug 2023

Description

Extract the text before a specified substring in a string

Syntax

textBefore(input, substring)

Parameters

Input ParameterTypeDescription
inputstringThe input string to search within
substringstringThe substring to find and extract text before

Return value

Type
string

Sample

ExampleResultDescription
textBefore('1234 Invoice Number', ' Invoice')'1234'The text before the specified substring
textBefore('1234$', ' Invoice')''Return empty string if substring is not found

To view all the String functions, click here.

See Also