From 757a84bfdafddb4764bc787ad25c21f87fa99106 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 26 Jun 2022 04:51:31 +0200 Subject: [PATCH] fix a string bug --- ISBPL.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ISBPL.java b/ISBPL.java index f12c4e1..53e150d 100644 --- a/ISBPL.java +++ b/ISBPL.java @@ -1723,8 +1723,9 @@ public class ISBPL { String w = word.toString(); while(w.startsWith("(") && w.length() > 1) w = w.substring(1); - while(w.endsWith(")") && w.length() > 1) - w = w.substring(0, w.length() - 1); + if(!w.startsWith("\"")) + while(w.endsWith(")") && w.length() > 1) + w = w.substring(0, w.length() - 1); words.add(w); word = new StringBuilder(); } @@ -1735,8 +1736,9 @@ public class ISBPL { String w = word.toString(); while(w.startsWith("(") && w.length() > 1) w = w.substring(1); - while(w.endsWith(")") && w.length() > 1) - w = w.substring(0, w.length() - 1); + if(!w.startsWith("\"")) + while(w.endsWith(")") && w.length() > 1) + w = w.substring(0, w.length() - 1); words.add(w); ArrayList cleanWords = new ArrayList<>();