Skip to content

Commit

Permalink
Update TextAPI.java
Browse files Browse the repository at this point in the history
  • Loading branch information
LucFr1746 committed Dec 6, 2024
1 parent b2ae4d4 commit 57f891c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/io/github/lucfr1746/LLib/Utils/TextAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 57f891c

Please sign in to comment.