github.com/jbramsden/hugo@v0.47.1/docs/content/en/functions/substr.md (about)

     1  ---
     2  title: substr
     3  # linktitle:
     4  description: Extracts parts of a string from a specified character's position and returns the specified number of characters.
     5  godocref:
     6  date: 2017-02-01
     7  publishdate: 2017-02-01
     8  lastmod: 2017-02-01
     9  categories: [functions]
    10  menu:
    11    docs:
    12      parent: "functions"
    13  keywords: [strings]
    14  aliases: []
    15  signature: ["substr STRING START [LENGTH]"]
    16  workson: []
    17  hugoversion:
    18  relatedfuncs: []
    19  deprecated: false
    20  ---
    21  
    22  It normally takes two parameters: `start` and `length`. It can also take one parameter: `start`, i.e. `length` is omitted, in which case the substring starting from start until the end of the string will be returned.
    23  
    24  To extract characters from the end of the string, use a negative start number.
    25  
    26  In addition, borrowing from the extended behavior described at http://php.net substr, if `length` is given and is negative, that number of characters will be omitted from the end of string.
    27  
    28  ```
    29  {{substr "BatMan" 0 -3}} → "Bat"
    30  {{substr "BatMan" 3 3}} → "Man"
    31  ```