1---
2title: strings.HasSuffix
3description: Determine whether or not a given string ends with the provided trailing suffix string.
4date: 2019-08-13
5publishdate: 2019-08-13
6lastmod: 2019-08-13
7categories: [functions]
8menu:
9  docs:
10    parent: "functions"
11keywords: [strings]
12signature: ["strings.HasSuffix STRING SUFFIX"]
13workson: []
14hugoversion:
15relatedfuncs: [hasPrefix]
16deprecated: false
17aliases: []
18---
19
20    {{ $pdfPath := "/path/to/some.pdf" }}
21    {{ strings.HasSuffix $pdfPath "pdf" }} → true
22    {{ strings.HasSuffix $pdfPath "txt" }} → false
23