strings.trim() function

Warning! This page documents an earlier version of Flux, which is no longer actively developed. Flux v0.65 is the most recent stable version of Flux.

The strings.trim() function removes leading and trailing characters specified in the cutset from a string.

Output data type: String

import "strings"

strings.trim(v: ".abc.", cutset: ".")

// returns "abc"



String to remove characters from.

Data type: String


The leading and trailing characters to remove from the string. Only characters that match the cutset string exactly are trimmed.

Data type: String


Trim leading and trailing periods from all values in a column
import "strings"

  |> map(fn: (r) => ({
      r with
      variables: strings.trim(v: r.variables, cutset: ".")