Name

endswith — Tests if a string ends with the specified suffix.

Syntax

endswith(string, suffix)
              

The ENDSWITH function has the following arguments:

string

The string to test for the suffix.

suffix

The suffix to test.

Description

Return true if the input string ends with the suffix, and false otherwise.

Examples

Formula

Description

Result

endswith('Hello', 'lo')

Test if 'lo' is a suffix of 'Hello'

true

endswith('Hello', 'abc')

Test if 'abc' is a suffix of 'Hello'

false

endswith('Hello', 'Hello')

Test if 'Hello' is a suffix of 'Hello'

true

endswith('', '')

Test if '' (empty string) is a suffix of '' (empty string)

true

endswith('HELLO', 'lo')

Test if 'lo' is a suffix of 'HELLO'. Since the test is case-sensitive the test will fail.

false