Package com.marcpg.libpg.text
Class Formatter
java.lang.Object
com.marcpg.libpg.text.Formatter
Used to format text.
- Since:
- 0.0.1
-
Method Summary
Modifier and TypeMethodDescriptionWraps a long string into multiple lines based on a max length/width per line.static @NotNull String
toPascalCase
(@NotNull String in) Convert astring
in "TEST_STRING" format to pascal case: "Test String".
-
Method Details
-
toPascalCase
Convert astring
in "TEST_STRING" format to pascal case: "Test String". -
lineWrap
Wraps a long string into multiple lines based on a max length/width per line. Will split based on words separated by spaces, to avoid splitting in the middle of a word.- Parameters:
text
- The text that should be line wrapped.maxWidth
- The maximum length/width per line in characters.- Returns:
- The line-wrapped text, as a list where each value represents a line.
- Since:
- 0.0.8
-