mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-17 12:24:35 -04:00
Cleanup hasPrefix hasSuffix
This commit is contained in:
parent
7bee3e4c14
commit
47535dc873
@ -1,13 +0,0 @@
|
||||
---
|
||||
title: hasprefix
|
||||
description: Tests whether a string begins with prefix.
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
keywords: [strings]
|
||||
signature: ["hasPrefix STRING PREFIX"]
|
||||
relatedfuncs: [hasSuffix]
|
||||
---
|
||||
|
||||
* `{{ hasPrefix "Hugo" "Hu" }}` → true
|
@ -1,13 +0,0 @@
|
||||
---
|
||||
title: hasSuffix
|
||||
description: Tests whether a string ends with suffix.
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
keywords: [strings]
|
||||
signature: ["hasSuffix STRING SUFFIX"]
|
||||
relatedfuncs: [hasPrefix]
|
||||
---
|
||||
|
||||
* `{{ hasSuffix "Hugo" "go" }}` → true
|
16
content/en/functions/strings.HasPrefix.md
Normal file
16
content/en/functions/strings.HasPrefix.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: strings.HasPrefix
|
||||
description: Tests whether a string begins with prefix.
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
keywords: [strings]
|
||||
signature: ["hasPrefix STRING PREFIX","strings.HasPrefix STRING PREFIX"]
|
||||
relatedfuncs: [hasSuffix]
|
||||
aliases: [/functions/hasprefix/]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ hasPrefix "Hugo" "Hu" }} → true
|
||||
```
|
@ -1,15 +1,16 @@
|
||||
---
|
||||
title: strings.HasSuffix
|
||||
description: Determine whether a given string ends with the provided trailing suffix string.
|
||||
description: Tests whether a string ends with suffix.
|
||||
categories: [functions]
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
keywords: [strings]
|
||||
signature: ["strings.HasSuffix STRING SUFFIX"]
|
||||
signature: ["hasSuffix STRING SUFFIX","strings.HasSuffix STRING SUFFIX"]
|
||||
relatedfuncs: [hasPrefix]
|
||||
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
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user