to_sentence
Given an array of strings, outputs an English representation of that array.
Parameters
input
(Array<String>
)
An array of strings
Returns (String
)
The strings formatted as an English phrase
Examples
One string
{{ ["one fish"] | to_sentence }} => one fish
Two strings
{{ ["one fish", "two fish"] | to_sentence }} => one fish and two fish
More than two strings
{{ ["one fish", "two fish", "red fish", "blue fish"] | to_sentence }}
=> one fish, two fish, red fish, and blue fish