From fa5533c69b7e3def857296f26278e36194b0f499 Mon Sep 17 00:00:00 2001 From: Dan Siddoway Date: Thu, 15 Aug 2019 19:18:09 -0700 Subject: [PATCH] Add `strings.HasSuffix` documentation I tracked this down *via* . It came in handy for me; may it do so for others as well. --- content/en/functions/strings.HasSuffix.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 content/en/functions/strings.HasSuffix.md diff --git a/content/en/functions/strings.HasSuffix.md b/content/en/functions/strings.HasSuffix.md new file mode 100644 index 000000000..347e249da --- /dev/null +++ b/content/en/functions/strings.HasSuffix.md @@ -0,0 +1,23 @@ +--- +title: strings.HasSuffix +description: Determine whether or not a given string ends with the provided trailing suffix string. +godocref: +date: 2019-08-13 +publishdate: 2019-08-13 +lastmod: 2019-08-13 +categories: [functions] +menu: + docs: + parent: "functions" +keywords: [strings] +signature: ["strings.HasSuffix STRING SUFFIX"] +workson: [] +hugoversion: +relatedfuncs: [hasPrefix] +deprecated: false +aliases: [] +--- + + {{ $pdfPath := "/path/to/some.pdf" }} + {{ strings.HasSuffix $pdfPath "pdf" }} → true + {{ strings.HasSuffix $pdfPath "txt" }} → false