Skip to content

Commit

Permalink
chore: [release-3.0.x] docs: Update template_functions.md (#13052)
Browse files Browse the repository at this point in the history
Co-authored-by: Pangidoan Butar <38452094+doanbutar@users.noreply.github.com>
  • Loading branch information
grafanabot and doanbutar committed May 28, 2024
1 parent 4835135 commit 49d3d48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/sources/query/template_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,26 +303,26 @@ Example:

Use this function to test to see if one string is contained inside of another.

Signature: `contains(s string, src string) bool`
Signature: `contains(src string, s string,) bool`

Examples:

```template
{{ if contains .err "ErrTimeout" }} timeout {{end}}
{{ if contains "ErrTimeout" .err }} timeout {{end}}
{{ if contains "he" "hello" }} yes {{end}}
```

## eq

Use this function to test to see if one string has exact matching inside of another.

Signature: `eq(s string, src string) bool`
Signature: `eq(src string, s string) bool`

Examples:

```template
{{ if eq .err "ErrTimeout" }} timeout {{end}}
{{ if eq "he" "hello" }} yes {{end}}
{{ if eq "ErrTimeout" .err}} timeout {{end}}
{{ if eq "hello" "hello" }} yes {{end}}
```

## hasPrefix and hasSuffix
Expand Down

0 comments on commit 49d3d48

Please sign in to comment.