Right trim string

Supported in: Batch, Faster

Removes the given characters from the end of a string. Without characters, removes spaces only, not other whitespace.

Expression categories: Data preparation, String

Declared arguments

  • Expression: The string to trim.
    Expression<String>
  • optional Characters: Each character in this string is removed. Defaults to a space.
    Expression<String>

Output type: String

Examples

Example 1: Base case

Argument values:

  • Expression: hello world
  • Characters: null

Output: hello world


Example 2: Base case

Argument values:

  • Expression: xyhello worldxyx
  • Characters: xy

Output: xyhello world


Example 3: Null case

Argument values:

  • Expression: string
  • Characters: characters
stringcharactersOutput
nullxnull
helloxnullnull
nullnullnull

Example 4: Edge case

Description: Without characters, only spaces are removed, not tabs, newlines or other whitespace.

Argument values:

  • Expression: string
  • Characters: null
stringOutput
hellohello
hello
hello
hello  hello  
empty string
empty stringempty string
nullnull