"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/content/en/functions/substr.md" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

substr.md  (hugo-0.80.0):substr.md  (hugo-0.81.0)
skipping to change at line 29 skipping to change at line 29
deprecated: false deprecated: false
--- ---
It normally takes two parameters: `start` and `length`. It can also take one par ameter: `start`, i.e. `length` is omitted, in which case the substring starting from start until the end of the string will be returned. It normally takes two parameters: `start` and `length`. It can also take one par ameter: `start`, i.e. `length` is omitted, in which case the substring starting from start until the end of the string will be returned.
To extract characters from the end of the string, use a negative start number. To extract characters from the end of the string, use a negative start number.
In addition, borrowing from the extended behavior described at https://php.net s ubstr, if `length` is given and is negative, that number of characters will be o mitted from the end of string. In addition, borrowing from the extended behavior described at https://php.net s ubstr, if `length` is given and is negative, that number of characters will be o mitted from the end of string.
``` ```
{{substr "BatMan" 0 -3}}"Bat" {{ substr "abcdef" 0 }}"abcdef"
{{substr "BatMan" 3 3}}"Man" {{ substr "abcdef" 1 }}"bcdef"
{{ substr "abcdef" 0 1 }} → "a"
{{ substr "abcdef" 1 1 }} → "b"
{{ substr "abcdef" 0 -1 }} → "abcde"
{{ substr "abcdef" 1 -1 }} → "bcde"
{{ substr "abcdef" -1 }} → "f"
{{ substr "abcdef" -2 }} → "ef"
{{ substr "abcdef" -1 1 }} → "f"
{{ substr "abcdef" -2 1 }} → "e"
{{ substr "abcdef" -3 -1 }} → "de"
{{ substr "abcdef" -3 -2 }} → "d"
``` ```
 End of changes. 1 change blocks. 
2 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)