0

I have a string in jstl: 'Tall &. Big' But I want this to replace with :'TallBig'.

I am trying to this by using fn:replace(String,'&',''); but I don't know how to mention multiple characters in this function to be removed.

Means I want to remove all special characters from a string.

Rahul
  • 133
  • 10
  • refer to http://stackoverflow.com/questions/1120198/most-efficient-way-to-remove-special-characters-from-string. It does a similar if I understand the question. – CodeNoob Jul 25 '12 at 06:57
  • You could do `fn:replace("Tall &. Big", " &. ", "");` – tenorsax Jul 25 '12 at 06:58
  • Max, this is not working what you suggested. I already tried this. – Rahul Jul 25 '12 at 07:07
  • @CodeNoob , That is not in JSTL. I want to do this in JSTL – Rahul Jul 25 '12 at 07:13
  • @Rahul: define "not working". Max's suggestion does what you want. – JB Nizet Jul 25 '12 at 07:19
  • @JBNizet , Actually I am getting value from backend as 'Tall &. Big'. I want to make it 'TallBig', and want to use it as a id in html element. I tried fn:replace("Tall &. Big", "&", "")---working(removing &) But fn:replace("Tall &. Big", " &. ", "") is not working – Rahul Jul 25 '12 at 07:30

0 Answers0