Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-22 16:47:07 +02:00
341 changed files with 3107 additions and 4238 deletions

View File

@@ -1,22 +1,16 @@
---
title: strings.HasSuffix
description: Determine whether a given string ends with the provided trailing suffix string.
date: 2019-08-13
publishdate: 2019-08-13
lastmod: 2019-08-13
description: Tests whether a string ends with suffix.
categories: [functions]
menu:
docs:
parent: "functions"
parent: functions
keywords: [strings]
signature: ["strings.HasSuffix STRING SUFFIX"]
workson: []
hugoversion:
signature: ["hasSuffix STRING SUFFIX","strings.HasSuffix STRING SUFFIX"]
relatedfuncs: [hasPrefix]
deprecated: false
aliases: []
aliases: [/functions/hassuffix/]
---
{{ $pdfPath := "/path/to/some.pdf" }}
{{ strings.HasSuffix $pdfPath "pdf" }} → true
{{ strings.HasSuffix $pdfPath "txt" }} → false
```go-html-template
{{ hasSuffix "Hugo" "go" }} → true
```