HUGO
News
Docs
Themes
Showcase
Community
GitHub
Search
Star
About Hugo
Overview
Hugo and GDPR
Hugo 0.32 HOWTO
What is Hugo
Hugo Features
The Benefits of Static
License
Getting Started
Get Started Overview
Quick Start
Install Hugo
Basic Usage
Directory Structure
Configuration
Themes
Themes Overview
Install and Use Themes
Theme Components
Create a Theme
Content Management
Content Management Overview
Organization
Page Bundles
Supported Content Formats
Front Matter
Page Resources
Image Processing
Shortcodes
Related Content
Sections
Types
Archetypes
Taxonomies
Summaries
Links and Cross References
URL Management
Menus
Static Files
Table of Contents
Comments
Multilingual and i18n
Syntax Highlighting
Templates
Templates Overview
Introduction
Template Lookup Order
Custom Output Formats
Base Templates and Blocks
List Page Templates
Homepage Template
Section Templates
Taxonomy Templates
Single Page Templates
Content View Templates
Data Templates
Partial Templates
Shortcode Templates
Local File Templates
404 Page
Menu Templates
Pagination
RSS Templates
Sitemap Template
Robots.txt
Internal Templates
Alternative Templating
Template Debugging
Functions
Functions Quick Reference
Built-in
Cast
Collections
Compare
Crypto
Data
Encoding
Fmt
Hugo
Images
Inflect
Lang
Math
OS
Partials
Path
Reflect
Resources
Safe
Site
Strings
Templates
Time
Transform
URLs
Objects
Objects Overview
Site Objects
Page Objects
Shortcode Objects
Time Objects
Taxonomy Objects
File Objects
Menu Entry Objects
Hugo Objects
Git Objects
Sitemap Objects
Hugo Pipes
Hugo Pipes Overview
Hugo Pipes Introduction
SASS / SCSS
PostCSS
Asset minification
Asset bundling
Fingerprinting and SRI
Resource from Template
Resource from String
CLI
Troubleshooting
Troubleshoot
FAQ
Build Performance
Tools
Developer Tools Overview
Migrations
Starter Kits
Frontends
Editor Plug-ins
Search
Other Projects
Hosting & Deployment
Hosting & Deployment Overview
Host-Agnostic Deploys with Nanobox
Host on Netlify
Host on Firebase
Host on GitHub
Host on GitLab
Hosting on KeyCDN
Host on Bitbucket
Deployment with Wercker
Deployment with Rsync
Contribute
Contribute to Hugo
Development
Documentation
Themes
Maintenance
Strings
Module strings provides template functions for manipulating strings.
strings.RuneCount
Determines the number of runes in a string.
Read More »
strings.Repeat
Returns a string consisting of count copies of the string s.
Read More »
chomp
Removes any trailing newline characters.
Read More »
countrunes
Determines the number of runes in a string excluding any whitespace.
Read More »
countwords
Counts the number of words in a string.
Read More »
findRE
Returns a list of strings that match the regular expression.
Read More »
hasPrefix
Tests whether a string begins with prefix.
Read More »
lower
Converts all characters in the provided string to lowercase.
Read More »
replace
Replaces all occurrences of the search string with the replacement string.
Read More »
replaceRE
Replaces all occurrences of a regular expression with the replacement pattern.
Read More »
slicestr
Creates a slice of a half-open range, including start and end indices.
Read More »
split
splits a string into substrings separated by a delimiter
Read More »
strings.TrimLeft
Returns a slice of a given string with all leading characters contained in the cutset removed.
Read More »
strings.TrimPrefix
Returns a given string s without the provided leading prefix string. If s doesn’t start with prefix, s is returned unchanged.
Read More »
strings.TrimRight
Returns a slice of a given string with all trailing characters contained in the cutset removed.
Read More »
strings.TrimSuffix
Returns a given string s without the provided trailing suffix string. If s doesn’t end with suffix, s is returned unchanged.
Read More »
substr
Extracts parts of a string from a specified character’s position and returns the specified number of characters.
Read More »
title
Converts all characters in the provided string to title case.
Read More »
trim
Returns a slice of a passed string with all leading and trailing characters from cutset removed.
Read More »
truncate
Truncates a text to a max length without cutting words or leaving unclosed HTML tags.
Read More »
upper
Converts all characters in a string to uppercase
Read More »