Subversion Repository Public Repository

litesoft

Diff Revisions 628 vs 629 for /trunk/GWT_Sandbox/FormEngine/src/com/temp/shared/utils/StringUtils.java

Diff revisions: vs.
  @@ -285,4 +285,23 @@
285 285 }
286 286 return -1;
287 287 }
288 +
289 + /**
290 + * NBSPs are converted to a space.
291 + */
292 + public static String convertNBSPsToSpaces(String text) {
293 + if (text != null) {
294 + int at = text.indexOf('&');
295 + if (at != -1) {
296 + int sourceTextDelta = 0;
297 + String indexe = text.toLowerCase(); // . . . . . 0123456
298 + for (int from = at; -1 != (at = indexe.indexOf( " ", from )); from = at + 6) {
299 + int sourceAt = at + sourceTextDelta;
300 + text = text.substring(0,sourceAt) + ' ' + text.substring(sourceAt + 6);
301 + sourceTextDelta -= 5;
302 + }
303 + }
304 + }
305 + return text;
306 + }
288 307 }