aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/utils
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-12 18:33:55 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-12 18:33:55 +0900
commitbbbf49cef6d8ed46b3fc5d69ff880137e62084de (patch)
treee141602a5cee61ace54dda0f68288dc531cb9ef8 /src/main/java/kr/syeyoung/dungeonsguide/utils
parent75aa91678c2dfdf844ecfcbb68bcf9389028ca4e (diff)
downloadSkyblock-Dungeons-Guide-bbbf49cef6d8ed46b3fc5d69ff880137e62084de.tar.gz
Skyblock-Dungeons-Guide-bbbf49cef6d8ed46b3fc5d69ff880137e62084de.tar.bz2
Skyblock-Dungeons-Guide-bbbf49cef6d8ed46b3fc5d69ff880137e62084de.zip
secrets!
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/utils')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
index ee4d056c..d56584c3 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/TextUtils.java
@@ -1,6 +1,7 @@
package kr.syeyoung.dungeonsguide.utils;
import java.text.DecimalFormat;
+import java.util.List;
import java.util.regex.Pattern;
public class TextUtils {
@@ -22,4 +23,14 @@ public class TextUtils {
return INTEGER_CHARACTERS.matcher(text).replaceAll("");
}
+ public static String join(List list, String delimeter) {
+ if (list.isEmpty()) return "";
+ StringBuilder stringBuilder = new StringBuilder();
+ for (int i = 0; i < list.size() - 1; i++) {
+ stringBuilder.append(list.get(i).toString()).append(delimeter);
+ }
+ stringBuilder.append(list.get(list.size() - 1).toString());
+ return stringBuilder.toString();
+ }
+
} \ No newline at end of file