Documentation

strings.trimSpace() function

The strings.trimSpace() function removes leading and trailing spaces from a string.

Output data type: String

import "strings"

strings.trimSpace(v: "  abc  ")

// returns "abc"

Parameters

v

String to remove spaces from.

Data type: String

Examples

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

data
  |> map(fn: (r) => ({ r with userInput: strings.trimSpace(v: r.userInput) }))

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: