diff --git a/src/main/java/io/github/lucfr1746/LLib/Utils/TextAPI.java b/src/main/java/io/github/lucfr1746/LLib/Utils/TextAPI.java index c32f185..74f20fb 100644 --- a/src/main/java/io/github/lucfr1746/LLib/Utils/TextAPI.java +++ b/src/main/java/io/github/lucfr1746/LLib/Utils/TextAPI.java @@ -220,4 +220,12 @@ public boolean isInteger() { } return true; } + + public TextAPI convertToEnumStringFormat() { + this.text = this.text.toUpperCase() + .replaceAll(" +", "_") // Replace all spaces with single underscores + .replaceAll("_+", "_") // Replace all underscores with single underscores + .replaceAll("^_+|_+$", ""); // Trim leading/trailing underscores + return this; + } }