Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Returns the number of characters in a string.
Syntax
char_length(<string>)
character_length(<string>)
Arguments
Required
<string>: The string to measure.
Returns
Returns an integer representing the number of characters in the string.
Considerations
- Counts characters, not bytes (important for multi-byte UTF-8 characters).
- The
char_lengthandcharacter_lengthfunctions are equivalent.
Examples
Count Characters
Get the character count of a string.
SELECT char_length('jose') AS result;
Returns 4.