Class WhitespaceConversions


  • public final class WhitespaceConversions
    extends Object
    Utilities for handling whitespace options.
    Author:
    Dennis M. Sosnoski
    • Method Detail

      • replace

        public static String replace​(String text)
        Replace non-space whitespace in string. This first scans to see if any non-space whitespace is present, and if so, invokes the actual conversion handling.
        Parameters:
        text - value to be converted (null if none)
        Returns:
        replaced string value (null if none)
      • collapse

        public static String collapse​(String text)
        Collapse whitespace in string. This first scans to see if any whitespace is present, and if so, invokes the actual conversion handling.
        Parameters:
        text - value to be converted (null if none)
        Returns:
        collapsed string value (null if none)
      • trim

        public static String trim​(String text)
        Trim leading and trailing whitespace in string.
        Parameters:
        text - value to be converted (null if none)
        Returns:
        trimmed string value (null if none)