strings.ends_with

Supported in:
strings.ends_with(value, suffix)

Description

Function takes two STRINGs (value, suffix). Returns TRUE if suffix is non-empty and at end of value.

Param data types

STRING, STRING

Return type

BOOL

Code samples

Example 1

Returns true when suffix is found at end of value.

strings.ends_with("this is a test", "test") = true
Example 2

Returns false when suffix is not at end of value.

strings.ends_with("this is a test", "is") = false
Example 3

Returns false when suffix and value are identical.

strings.ends_with("str", "str") = true
Example 4

Returns false when suffix is an empty string.

strings.ends_with("str", "") = false
Example 5

Returns false when value is an empty string.

strings.ends_with("", "str") = false
Example 6

Returns false when suffix and value are empty strings.

strings.ends_with("", "") = false