Skip to main content

trim

Description

Removes whitespace from both the start and end of a string.

Syntax

Like many functions in DataPrime, trim supports two notations, function and method. These interchangeable forms allow flexibility in how you structure expressions.

trim(value: string): string

Arguments

NameTypeRequiredDescription
valuestringtrueThe string to trim

Example

Clean up an extracted username

Use trim to remove the extra spaces:

Example data

{
"username": " SyntaxTerror "
}

Example query

create trimmed_user from trim(username)

Example output

{
"username": " SyntaxTerror ",
"trimmed_user": "SyntaxTerror"
}
Was this page helpful?