mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 08:18:30 +00:00
Cleanup hasPrefix hasSuffix
This commit is contained in:
1 parent
7bee3e4c14
commit
47535dc873
4 files changed
+22
-31
No files matched your search
@@ -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
|
|
||||||
@@ -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
|
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]
|
categories: [functions]
|
||||||
menu:
|
menu:
|
||||||
docs:
|
docs:
|
||||||
parent: functions
|
parent: functions
|
||||||
keywords: [strings]
|
keywords: [strings]
|
||||||
signature: ["strings.HasSuffix STRING SUFFIX"]
|
signature: ["hasSuffix STRING SUFFIX","strings.HasSuffix STRING SUFFIX"]
|
||||||
relatedfuncs: [hasPrefix]
|
relatedfuncs: [hasPrefix]
|
||||||
|
aliases: [/functions/hassuffix/]
|
||||||
---
|
---
|
||||||
|
|
||||||
{{ $pdfPath := "/path/to/some.pdf" }}
|
```go-html-template
|
||||||
{{ strings.HasSuffix $pdfPath "pdf" }} → true
|
{{ hasSuffix "Hugo" "go" }} → true
|
||||||
{{ strings.HasSuffix $pdfPath "txt" }} → false
|
```
|
||||||
Reference in new issue
Block a user