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.
cutset
The leading characters to remove from the string.
Only characters that match the cutset
string exactly are removed.
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: ".")}))
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.