📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

TRIM_BOTH



Removes all occurrences of the specified trim string from the beginning, end, or both sides of the string.

See also: TRIM

Syntax

TRIM_BOTH(<string>, <trim_string>)

Examples

SELECT TRIM_BOTH('xxdatalakexx', 'xxx'), TRIM_BOTH('xxdatalakexx', 'xx'), TRIM_BOTH('xxdatalakexx', 'x'); ┌─────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ trim_both('xxdatalakexx', 'xxx') │ trim_both('xxdatalakexx', 'xx') │ trim_both('xxdatalakexx', 'x') │ ├──────────────────────────────────┼─────────────────────────────────┼────────────────────────────────┤ │ xxdatalakexx │ datalake │ datalake │ └─────────────────────────────────────────────────────────────────────────────────────────────────────┘

Was this page helpful?