Class StringUtils

java.lang.Object
com.github.tommyettinger.textra.utils.StringUtils

public final class StringUtils extends Object
  • Method Details

    • join

      public static String join(CharSequence delimiter, CharSequence... items)
    • shuffleWords

      public static String shuffleWords(String text)
      Shuffles the words in text using MathUtils.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

      public static String shuffleWords(String text, Random generator)
      Shuffles the words in text using 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