From d1c0e9eff8b9a23f5297eaf6117bb50b1f713be0 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 7 May 2020 22:38:10 +1200 Subject: [PATCH] Handle when a string has an actual newline in it --- .../libraryaddict/disguise/utilities/DisguiseUtilities.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 111ba41d..da527647 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -1761,6 +1761,10 @@ public class DisguiseUtilities { } public static String[] splitNewLine(String string) { + if (string.contains("\n")) { + return string.split("\n"); + } + Pattern regex = Pattern.compile("\\\\+n"); Matcher result = regex.matcher(string);