Class StringWrap

java.lang.Object
org.apache.jorphan.util.StringWrap

@API(since="5.5", status=EXPERIMENTAL) public class StringWrap extends Object
Wraps text in such a way so the lines do not exceed given maximum length.
  • Constructor Details

    • StringWrap

      public StringWrap(int minWrap, int maxWrap)
      Creates string wrapper instance.
      Parameters:
      minWrap - minimal word length for the wrap
      maxWrap - maximum word length for the wrap
  • Method Details

    • getMinWrap

      public int getMinWrap()
    • getMaxWrap

      public int getMaxWrap()
    • wrap

      public String wrap(String input, String delimiter)
      Wraps given input text accoding to
      Parameters:
      input - input text
      delimiter - delimiter when inserting soft wraps
      Returns:
      modified text with added soft wraps, or input if wraps are not needed