diff --git a/src/main/java/com/orgzly/org/utils/ArrayListSpaceSeparated.java b/src/main/java/com/orgzly/org/utils/ArrayListSpaceSeparated.java index ad63279..63ea5da 100644 --- a/src/main/java/com/orgzly/org/utils/ArrayListSpaceSeparated.java +++ b/src/main/java/com/orgzly/org/utils/ArrayListSpaceSeparated.java @@ -13,7 +13,7 @@ public ArrayListSpaceSeparated() { public ArrayListSpaceSeparated(String str) { for (String s: str.split(DELIMITER)) { - String st = s.trim(); + String st = s.trim().replace("\\s", " ").replace("\\ ", "\\s"); if (st.length() > 0) { add(st); } @@ -21,6 +21,10 @@ public ArrayListSpaceSeparated(String str) { } public String toString() { - return OrgStringUtils.join(this, DELIMITER); + String str = ""; + for (String s: this) { + str += s.replace("\\s", "\\\\s").replace(" ", "\\s") + " "; + } + return str.substring(0, str.length() - 1); } }