Documentation

strings.trimLeft() function

The strings.trimLeft() function removes specified leading characters from a string.

Output data type: String

import "strings"

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

// returns "abc."

Parameters

v

String to remove characters from.

Data type: String

cutset

The leading characters to remove from the string. Only characters that match the cutset string exactly are removed.

Data type: String

Examples

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

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

New! Cloud or OSS?

InfluxDB OSS 2.0 now generally available!

InfluxDB OSS 2.0 is now generally available and ready for production use. See the InfluxDB OSS 2.0 release notes.

For information about upgrading to InfluxDB OSS 2.0, see: