Back to Hugo

strings.Chomp

docs/content/en/functions/strings/Chomp.md

0.161.1241 B
Original Source

If the argument is of type template.HTML, returns template.HTML, else returns a string.

go-html-template
{{ chomp "foo\n" }} → foo
{{ chomp "foo\n\n" }} → foo

{{ chomp "foo\r\n" }} → foo
{{ chomp "foo\r\n\r\n" }} → foo