+ /**
+ * The implementation of this trim method also checks for
+ * no brake space characters (nbsp) = '\00A0'
+ * and removes them
+ *
+ * @param input
+ * @return the new trimmed string without whitespace or no brake space
+ */
+ public static native String trim(String input) /*-{
+ if(input.length == 0)
+ return input;
+ if((input[0]||input[input.length-1]) != '\u0020' && (input[0]||input[input.length-1]) != '\u00A0')
+ return input;
+ var r1 = input.replace(/^(\s*)/, '');
+ var r2 = r1.replace(/\s*$/, '');
+ return r2;
+ }-*/;