TEXTBEFORE

Returns the part of a text before a specified delimiter

Usage

TEXTBEFORE(text, delimiter, case_sensitive: TRUE, from_end: FALSE, if_not_found: NOTHING, skip: 0)

Parameters

text

(Required) The text from which to extract the substring.

delimiter

(Required) The delimiter that marks the end of the substring to be extracted.

case_sensitive:

(Named) Whether the search for the delimiter is case-sensitive. Default is TRUE.

from_end:

(Named) Whether to search for the delimiter from the end of the text. Default is FALSE.

if_not_found:

(Named) The text to return if the delimiter is not found. Default is NOTHING, which reports an error.

skip:

(Named) The number of occurrences of the delimiter to skip before extracting the substring. Default is 0.

Parameters with “Named” mean that you must specify the name of the parameter and a colon before its value. Ex: case_sensitive: "its value"

Examples

Example With these variables Result

TEXTBEFORE(“Anna Logwatch/[email protected]”, “/”)

(None)

“Anna Logwatch”

TEXTBEFORE(address, separator)

address is "123 Main Street, City"
separator is ","

“123 Main Street”

TEXTBEFORE(“4 8 15 16 23 42”, “ “, skip: 2)

(None)

“4 8 15”

TEXTBEFORE(“ABigLongWord”, “ “, if_not_found: “No spaces!”)

(None)

“No spaces!”

TEXTBEFORE(“Anna Logwatch”, “WAT”, case_sensitive: FALSE)

(None)

“Anna Log”

TEXTBEFORE(“4 8 15 16 23 42”, “ “, from_end: TRUE, skip: 1)

(None)

“4 8 15 16”

See also