- Description: Removes specified characters from the beginning and/or end of a string.
- Purpose: Cleaning up data inputs.
- Syntax:
TRIM([LEADING | TRAILING | BOTH] trim_character FROM string)
- Parameters:
trim_character
: Character to trim (defaults to space).string
: The source string.
- Returns: The cleaned string.
- Example:
TRIM(' ' FROM ' Hello ')
returns'Hello'
. - Notes: Can specify leading, trailing, or both.
- Use Case: Cleaning user inputs before processing.
Leave a Reply