Class TextUtils

java.lang.Object
org.pepsoft.util.TextUtils

public class TextUtils extends Object
  • Constructor Details

    • TextUtils

      public TextUtils()
  • Method Details

    • getLine

      public static String getLine(String text, int maxLineLength, int line)
      Breaks a text into lines of a specified maximum length and returns one the resulting lines. Existing line endings and other whitespace in the text is ignored. This method does not break words, so if there are words in the text that are longer than the maximum line length it will result in lines that are longer than the specified maximum length.
      Parameters:
      text - The text to break up.
      maxLineLength - The maximum length of the lines.
      line - The line to return.
      Returns:
      The specified line from the text broken up in lines. If the requested line lies beyond the end of the text, the empty string is returned.