Search code examples
templatesfor-looplinextend

Making for loop in xtend template, to print in same line


So if I have

«FOR number: numbers»
    «number»
 «ENDFOR»

It will print every number in new line, how do I make it print numbers in the same line?


Solution

  • Maybe not suitable for your usecase, but did you try

    «FOR number: numbers»«number»«ENDFOR»
    

    Another option is to use «numbers.join()»