TechnoCore
TechnoCore

Reputation: 1404

Avoid blanks in output loop

I use this JSTL statement ...

<c:forEach var="i" begin="1" end="5">
  <c:out value="${i}"/> 
</c:forEach>

and the result is:

1 2 3 4 5

Is there an easy way to avoid blanks in the output line? I would like to see an output like this:

12345

Upvotes: 1

Views: 44

Answers (1)

JB Nizet
JB Nizet

Reputation: 691765

<c:forEach var="i" begin="1" end="5"><c:out value="${i}"/></c:forEach>

or simply

<c:forEach var="i" begin="1" end="5">${i}</c:forEach>

Upvotes: 1

Related Questions