Skip to content

ltrim

Description

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

Syntax

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

ltrim(value: string): string
(value: string).ltrim(): string

Arguments

NameTypeRequiredDescription
valuestringtrueThe string to trim

Example

Clean up an extracted username

{
  "username": "   SyntaxTerror"
}

Use ltrim to remove the unwanted space:

Example query

create trimmed_user from ltrim(username)
create trimmed_user from username.ltrim()

Example output

{
  "username": "   SyntaxTerror",
  "trimmed_user": "SyntaxTerror"
}