helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

can you split a string with a delimiter and loop through and display with breaks? #371

Closed cpluceDev closed 4 years ago

cpluceDev commented 4 years ago

i have a string with a pipe or semicolon delimiter. Can i split this up and create an array than do a for each to display the values with a break or return carriage for each line? i know i can use the split function which gets me the index positions and a for each

thx

doowb commented 4 years ago
{{#each (split str "|") as |val|}}
  {{val}}<br />
{{/each}}

This should work? Have you tried it?

cpluceDev commented 4 years ago

thx