Skip to content

Commit 70c94c1

Browse files
authored
Doc - Avoid erro null $contains
Add to document a suggestion to avoid unexpected error when using `$contains`
1 parent e6e436d commit 70c94c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/string-functions.md

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ Returns `true` if `str` is matched by `pattern`, otherwise it returns `false`. I
122122

123123
The `pattern` parameter can either be a string or a regular expression (regex). If it is a string, the function returns `true` if the characters within `pattern` are contained contiguously within `str`. If it is a regex, the function will return `true` if the regex matches the contents of `str`.
124124

125+
The parameter `str` is required and cannot be undefined. When the parameter is a variable it is a good practice to wrap it with `$string` to avoid unexpected error.
126+
125127
__Examples__
126128

127129
- `$contains("abracadabra", "bra")` => `true`

0 commit comments

Comments
 (0)