strings.containsStr() function
The strings.containsStr()
function reports whether a string contains a specified substring.
Output data type: Boolean
import "strings"
strings.containsStr(v: "This and that", substr: "and")
// returns true
Parameters
v
The string value to search.
Data type: String
substr
The substring value to search for.
Data type: String
Examples
Report if a string contains a specific substring
import "strings"
data
|> map(fn: (r) => ({
r with
_value: strings.containsStr(v: r.author, substr: "John")
})
)
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.