k8wiz
Helm
Hard
Templates

Which function trims trailing newlines from a string in templates?

Select your answer:

Show answer and explanation

Answer: trimSuffix "\n"

Explanation

Helm has no chomp or stripNewline function. trimSuffix "\n" removes one trailing newline, and trim removes all leading and trailing whitespace, newlines included. nindent does the opposite: it adds a newline and indentation.

Read more about Helm