I am trying to remove all whitespaces from a jstl variable.
<c:set var="string1" value="This is first String "/>
Trim only removes the trailing spaces but I want the output like:
"ThisisfirstString "
with all spaces removed.Could anyone suggest?
Okay I got the answer:
<c:set var="string1" value="This is first String."/>
<c:set var="string2" value="${fn:replace(string1,' ', '')}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With