Background: I've written this before but I don't like the approach. The reason is because Javascript does not have "sprintf" and that is something I use heavily if the language supports it.
Question: How would you use javascript to go from BEFORE to AFTER? If anyone has a solution with very small number of lines of code, or something from a javascript string library, that would be informative. TIA.
BEFORE:
red| lightblue| green
cherry| ice| mint
round| cubic| flowery
AFTER:
red | lightblue | green
cherry | ice | mint
round | cubic | flowery
Disclaimer: This is not homework or any such thing, just looking for new ideas. Also, this is not browser-based javascript. This is not a web-development question, but a javascript programming question.