strings.hasPrefix() 函数
strings.hasPrefix() 表示一个字符串是否以指定的前缀开始。
函数类型签名
(prefix: string, v: string) => bool
有关更多信息,请参见 Function type signatures。
参数
v
(必填) 要搜索的字符串值。
前缀
(必填) 要搜索的前缀。
示例
基于列值中前缀的存在进行筛选
import "sampledata"
import "strings"
sampledata.string()
|> filter(fn: (r) => strings.hasPrefix(v: r._value, prefix: "smpl_5"))