mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-28 03:03:30 +00:00
25 lines
523 B
Markdown
25 lines
523 B
Markdown
|
---
|
||
|
title: strings.HasPrefix
|
||
|
description: Reports whether a string begins with prefix.
|
||
|
categories: [functions]
|
||
|
keywords: []
|
||
|
menu:
|
||
|
docs:
|
||
|
parent: functions
|
||
|
function:
|
||
|
aliases: [hasPrefix]
|
||
|
returnType: bool
|
||
|
signatures: [strings.HasPrefix STRING PREFIX]
|
||
|
relatedFunctions:
|
||
|
- strings.Contains
|
||
|
- strings.ContainsAny
|
||
|
- strings.ContainsNonSpace
|
||
|
- strings.HasPrefix
|
||
|
- strings.HasSuffix
|
||
|
aliases: [/functions/hasprefix,/functions/strings.hasprefix]
|
||
|
---
|
||
|
|
||
|
```go-html-template
|
||
|
{{ hasPrefix "Hugo" "Hu" }} → true
|
||
|
```
|