Revision c24efcc9 src/gr/ebs/gss/client/DisplayHelper.java
b/src/gr/ebs/gss/client/DisplayHelper.java | ||
---|---|---|
1 | 1 |
/* |
2 |
* Copyright 2009 Electronic Business Systems Ltd. |
|
2 |
* Copyright 2009, 2010 Electronic Business Systems Ltd.
|
|
3 | 3 |
* |
4 | 4 |
* This file is part of GSS. |
5 | 5 |
* |
... | ... | |
118 | 118 |
styleRow(table, row, true, styleName); |
119 | 119 |
return row; |
120 | 120 |
} |
121 |
/** |
|
122 |
* The implementation of this trim method also checks for |
|
123 |
* no brake space characters (nbsp) = '\00A0' |
|
124 |
* and removes them |
|
125 |
* |
|
126 |
* @param input |
|
127 |
* @return the new trimmed string without whitespace or no brake space |
|
128 |
*/ |
|
129 |
public static native String trim(String input) /*-{ |
|
130 |
if(input.length == 0) |
|
131 |
return input; |
|
132 |
if((input[0]||input[input.length-1]) != '\u0020' && (input[0]||input[input.length-1]) != '\u00A0') |
|
133 |
return input; |
|
134 |
var r1 = input.replace(/^(\s*)/, ''); |
|
135 |
var r2 = r1.replace(/\s*$/, ''); |
|
136 |
return r2; |
|
137 |
}-*/; |
|
121 | 138 |
|
122 | 139 |
} |
Also available in: Unified diff