String Functions
# StreamSQL String Functions
String functions are used for text processing.
# Basic String Functions
# UPPER - Uppercase Function
Syntax: upper(str)
Description: Converts a string to uppercase.
# LOWER - Lowercase Function
Syntax: lower(str)
Description: Converts a string to lowercase.
# CONCAT - String Concatenation Function
Syntax: concat(str1, str2, ...)
Description: Concatenates multiple strings.
# LENGTH - String Length Function
Syntax: length(str)
Description: Returns the length of a string.
# SUBSTRING - Substring Function
Syntax: substring(str, start, [length])
Description: Extracts a substring from a string.
# TRIM - Trim Function
Syntax: trim(str)
Description: Removes spaces from both ends of a string.
# LTRIM - Left Trim Function
Syntax: ltrim(str)
Description: Removes spaces from the left side of a string.
# RTRIM - Right Trim Function
Syntax: rtrim(str)
Description: Removes spaces from the right side of a string.
# FORMAT - Format Function
Syntax: format(format_str, ...)
Description: Formats a string according to the specified format.
# String Check Functions
# ENDSWITH - Ends With Function
Syntax: endswith(str, suffix)
Description: Checks if a string ends with the specified suffix.
# STARTSWITH - Starts With Function
Syntax: startswith(str, prefix)
Description: Checks if a string starts with the specified prefix.
# INDEXOF - Find Position Function
Syntax: indexof(str, substring)
Description: Returns the position of a substring within a string.
# String Manipulation Functions
# REPLACE - Replace Function
Syntax: replace(str, old_str, new_str)
Description: Replaces specified content in a string.
# SPLIT - Split Function
Syntax: split(str, delimiter)
Description: Splits a string using a delimiter.
# LPAD - Left Padding Function
Syntax: lpad(str, length, pad_str)
Description: Pads characters to the left of a string to the specified length.
# RPAD - Right Padding Function
Syntax: rpad(str, length, pad_str)
Description: Pads characters to the right of a string to the specified length.
# Regular Expression Functions
# REGEXP_MATCHES - Regex Match Function
Syntax: regexp_matches(str, pattern)
Description: Checks if a string matches a regular expression.
# REGEXP_REPLACE - Regex Replace Function
Syntax: regexp_replace(str, pattern, replacement)
Description: Replaces string content using regular expressions.
# REGEXP_SUBSTRING - Regex Extract Function
Syntax: regexp_substring(str, pattern)
Description: Extracts string content using regular expressions.
# 📚 Related Documentation
- Math Functions - Learn detailed usage of math functions
- Conversion Functions - Learn detailed usage of conversion functions
- SQL Reference - View complete SQL syntax reference