Class StringUtils
java.lang.Object
com.github.tommyettinger.textra.utils.StringUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringjoin(CharSequence delimiter, CharSequence... items) static StringshuffleWords(String text) Shuffles the words intextusingMathUtils.random, joins them with a space as the delimiter, and returns that String.static StringshuffleWords(String text, Random generator) Shuffles the words intextusing the given Random generator, joins them with a space as the delimiter, and returns that String.
-
Method Details
-
join
-
shuffleWords
Shuffles the words intextusingMathUtils.random, joins them with a space as the delimiter, and returns that String.- Parameters:
text- a String containing typically many whitespace-separated words- Returns:
- text with its words shuffled randomly
-
shuffleWords
Shuffles the words intextusing the given Random generator, joins them with a space as the delimiter, and returns that String. The generator can be seeded to get replicable results.- Parameters:
text- a String containing typically many whitespace-separated words- Returns:
- text with its words shuffled randomly
-