btrim
function
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above
Returns str
with leading and trailing characters removed.
Syntax
btrim( str [, trimStr ] )
Arguments
str
: A STRING expression to be trimmed.trimStr
: An optional STRING expression with characters to be trimmed. The default is a space character.
Returns
A STRING.
The function removes any leading and trailing characters within trimStr
from str
.
Examples
> SELECT 'X' || btrim(' SparkSQL ') || 'X';
XSparkSQLX
> SELECT btrim('abcaabaSparkSQLabcaaba', 'abc');
SparkSQL
Related functions
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for