Class StringHelpers

java.lang.Object
org.cyclops.cyclopscore.helper.StringHelpers

public final class StringHelpers extends Object
A collection of String helper methods.
  • Constructor Details

    • StringHelpers

      public StringHelpers()
  • Method Details

    • splitLines

      public static List<String> splitLines(String input, int maxLength, String prefix)
      Split the input string into lines while preserving the full words. This will also forcefully add newlines when '\n' is found in the input string.
      Parameters:
      input - The input sentence.
      maxLength - The maximum length of a line.
      prefix - A prefix to add to each produced line. This will not increase the character count per line.
      Returns:
      The sentence split into lines.