Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Removes specified characters from both the start and end of a string.
Syntax
btrim(<string> [, characters])
Arguments
Required
<string>: The string to trim.
Optional
characters: The characters to remove. Defaults to the space character.
Returns
Returns a text string with specified characters removed from both ends.
Considerations
- Removes individual characters from the set, not the string as a pattern.
- Continues removing until it encounters a character not in the set.
Examples
Trim Characters
Remove specified characters from both ends.
SELECT btrim('xyxtrimyyx', 'xyz') AS result;
Returns 'trim'.