mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
Merge commit 'f96384a3b596f9bc0a3a035970b09b2c601f0ccb'
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
Reference in New Issue
Block a user