strings.HasPrefix
Reports whether the given string begins with the given prefix.
- Syntax
- strings.HasPrefix STRING PREFIX
- Returns
- bool
- Alias
- hasPrefix
Usage
The strings.HasPrefix function reports whether the given string begins with the given prefix.
Examples
{{ strings.HasPrefix "Hugo" "Hu" }} → trueLast updated:
October 28, 2026
:
content: Apply style guide to strings functions (d6de31ebd)
Improve this page