MJ
asked on
Capture piece of tokenized string?
If I have the below code, is there any way to set the tokens to different variable names? For example anything other than doing something like this (if this even works)?
<% int cnt = 1; %>
<c:set var="string">LastName,Firs tName</c:s et>
<c:forTokens delims="," items="${string}" var="name">
<c:set var="new_value" value="${name}<%= cnt %>" />
<% cnt++; %>
</c:forTokens>
<% int cnt = 1; %>
<c:set var="string">LastName,Firs
<c:forTokens delims="," items="${string}" var="name">
<c:set var="new_value" value="${name}<%= cnt %>" />
<% cnt++; %>
</c:forTokens>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
]
<% int cnt = 1; %>
<c:set var="string">LastName,Firs
<c:forTokens delims="," items="${string}" var="name">
<c:set var="new_value<%= cnt %>" value="${name}" />
<% cnt++; %>
</c:forTokens>