Skip to main content

rtrim

Description

Removes whitespace from the end of a string while leaving the beginning unchanged.

Syntax

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

rtrim(value: string): string

Arguments

NameTypeRequiredDescription
valuestringtrueThe string to trim

Example

Clean up an extracted username

Consider the following document:

{
"username": "SyntaxTerror "
}

Use rtrim to remove the unwanted space:

Example query

create trimmed_user from rtrim(username)

Example output

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