I am using JSP EL. I have a string like "Village Green,Colgate University,Hamilton,NY". I want to show only Village Green. How can I do this?
<c:forEach items="${listOfSources}" var = "source">
<option value="${source }" >${source }</option>
</c:forEach>
The option value should be the whole string, but I want to show only Village Green to select. How can I achieve this?
Use just
substringBeforefromJSTLassuming that you needStringfrom0 to first,Code Snippet:
Document :
fn:substringBefore()