Name

startswith — Tests if a string starts with the specified suffix.

Syntax

startswith(string, prefix)
              

The STARTSWITH function has the following arguments:

string

The string to test for the prefix.

prefix

The prefix to test.

Description

Return true if the input string starts with the prefix, and false otherwise.

Examples

Formula

Description

Result

startswith('Hello', 'He')

Test if 'He' is a prefix of 'Hello'

true

startswith('Hello', 'abc')

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

false

startswith('Hello', 'Hello')

Test if 'Hello' is a prefix of 'Hello'

true

startswith('', '')

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

true

startswith('HELLO', 'he')

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

false