From 011ba91d87ba0911ed6252713894034083d618d4 Mon Sep 17 00:00:00 2001 From: Kevin Meyer Date: Thu, 13 Nov 2014 21:25:12 +0100 Subject: [PATCH] fixing issue #45: removing leading, trailing and multiple whitespaces. --- app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java b/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java index abaf227..9c38ec6 100644 --- a/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java +++ b/app/src/main/java/fr/gaulupeau/apps/Poche/Poche.java @@ -340,6 +340,11 @@ public class Poche extends Activity { s = s.replace("ï", "ï"); s = s.replace("ç", "ç"); s = s.replace("&", "&"); + + // Replace multiple whitespaces with single space + s = s.replaceAll("\\s+", " "); + s = s.trim(); + return s; }