Docs

v2.0

strings.trim() function

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"

Paramters

v

The string value from which to trim characters.

Data type: String

cutset

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

Data type: String

Examples

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

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

Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community