Links

TRIM_CHARS

Returns the given string without leading or trailing characters

Syntax

TRIM_CHARS(characters, input)

Arguments

Name
Type
Description
Default Value
characters
string
input
string

Returns

string

Examples

characters
input
Output
'-='
'-==--Hello World---=---'
Hello World
'-'
''
``
'-'
'-----------'
``
'-'
'x-----------'
x
'-'
'-----------x'
x
'-'
'------x-----'
x
'-'
'x-----------x'
x-----------x

Transformation job example

SQL

CREATE JOB function_operator_example
ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAME
SELECT characters, input,
TRIM_CHARS('-=', input) AS Output
FROM default_glue_catalog.upsolver_samples.orders_raw_data
LET characters = '-=',
input = '-==--Hello World---=---'
WHERE time_filter()
LIMIT 1;

Query result

characters
input
Output
'-='
'-==--Hello World---=---'
Hello World
Last modified 5mo ago