startswith
startswith(string
,prefix
)
The STARTSWITH function has the following arguments:
string
The string to test for the prefix.
prefix
The prefix to test.
Return true if the input string starts with the prefix, and false otherwise.
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 |