Docs

v2.0

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"

Paramters

v

The string value from which to trim spaces.

Data type: String

Examples

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

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

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