org.apache.jorphan.util

## 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 Summary

    Constructors
    Constructor and Description
    `StringWrap(int minWrap, int maxWrap)` Creates string wrapper instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getMaxWrap()`
    `int` | `getMinWrap()`
    `String` | `wrap(String input, String delimiter)` Wraps given `input` text accoding to

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 Detail

    - #### 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

Copyright © 1998-2022 Apache Software Foundation. All Rights Reserved.