views:

44

answers:

1

I am using GWT 2.0.4 and want to perform the trivial operation of replacing string. Something which can be done using java.lang in java, and since GWT doesn't support Java libraries and I want to avoid writing a JSNI, is there a way to do a string replace, Is there anything i am missing or might not knw? Latest version of GWT,which is just an RC, 2.1 has a library called com.google.gwt.regexp which have something as simple as originalString.replace(Expression String, Replacement String) but since it is RC, I cannot use it here, Any suggestions are appreciated and Thanks for helping.

+2  A: 

String.replaceAll() (any any java.lang method listed here) works in GWT.

Furthermore, it's incorrect to say "GWT doesn't support Java libraries" -- GWT supports lots of Java libraries, and many that aren't immediately usable can be made GWT compatible with a little work.

Jason Hall