I have used "RichTextArea" in GWT. Now i want to trim the text of the richtextarea.gettext() when i am submitting the form.
But if i have only entered spaces and enter key in my textarea then richtextarea.gettext() will not going to trim it as it will convert them to   and < br>.
Any suggestion if there are only entered spaces and enter key in my textarea then on trim it should give me blank string value?
That you get   and < br> is the correct value what you get from the RichTextArea because it supplies HTML.
Implement your own trim-method:
public String trim(String s) {
String result = s.trim();
String x = result.replaceAll("<br>", "");
x = x.replaceAll(" ", "");
x = x.trim();
if(x.equals("")) {
return x;
} else {
return result;
}
}