From 67cb5cc2b84743a936aeb8aa3b9e875b2e24a5ea Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Tue, 18 Aug 2020 18:56:52 -0400 Subject: Fix capitalization of pets Also move capitalization into Utils --- src/main/java/me/Danker/utils/Utils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/me/Danker/utils/Utils.java') diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java index 5dc30c6..835e613 100644 --- a/src/main/java/me/Danker/utils/Utils.java +++ b/src/main/java/me/Danker/utils/Utils.java @@ -103,4 +103,14 @@ public class Utils { inSkyblock = false; } + public static String capitalizeString(String string) { + String[] words = string.split("_"); + + for (int i = 0; i < words.length; i++) { + words[i] = words[i].substring(0, 1).toUpperCase() + words[i].substring(1).toLowerCase(); + } + + return String.join(" ", words); + } + } -- cgit