String & binary functions (General) , Semi-structured and structured data functions (Conversion/Casting)
Tokenizes the given string using the given set of delimiters and returns the tokens as an ARRAY value.
Syntax¶STRTOK_TO_ARRAY( <string> [ , <delimiter> ] )
Copy
Arguments¶Required:
string
Text to be tokenized.
Optional:
delimiter
Set of delimiters.
Default: A single space character.
This function returns a value of type ARRAY or NULL.
The function returns an empty array if tokenization produces no tokens.
If either argument is a NULL or JSON null value, the function returns NULL.
Examples¶The following example uses the STRTOK_TO_ARRAY function to split a string into an array:
SELECT STRTOK_TO_ARRAY('a.b.c', '.') AS string_to_array;
Copy
+-----------------+ | STRING_TO_ARRAY | |-----------------| | [ | | "a", | | "b", | | "c" | | ] | +-----------------+
The following example tokenizes on multiple delimiters (.
and @
):
SELECT STRTOK_TO_ARRAY('user@snowflake.com', '.@') AS multiple_delimiters;
Copy
+---------------------+ | MULTIPLE_DELIMITERS | |---------------------| | [ | | "user", | | "snowflake", | | "com" | | ] | +---------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4