1.2 KiB
1.2 KiB
title | description | aliases | menu | weight | related | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
strings.trimRight() function | The strings.trimRight() function removes trailing characters specified in the cutset from a string. |
|
|
301 |
|
The strings.trimRight()
function removes trailing characters specified in the
cutset
from a string.
Output data type: String
import "strings"
strings.trimRight(v: ".abc.", cutset: ".")
// returns "abc."
Parameters
v
String to remove characters from.
Data type: String
cutset
The trailing characters to trim from the string.
Only characters that match the cutset
string exactly are trimmed.
Data type: String
Examples
Trim trailing periods from all values in a column
import "strings"
data
|> map(fn: (r) => ({
r with
variables: strings.trimRight(v: r.variables, cutset: ".")
})
)