Class StringUtils

java.lang.Object
org.variantsync.diffdetective.util.StringUtils

public class StringUtils extends Object
A collection of useful utilities related to string processing.
  • Field Details

    • LINEBREAK

      public static final String LINEBREAK
      An operating system independent line break used in almost all internal strings.
      See Also:
    • LINEBREAK_REGEX

      public static final Pattern LINEBREAK_REGEX
      A regex to identify line breaks of any operating system .
  • Constructor Details

    • StringUtils

      public StringUtils()
  • Method Details

    • clear

      public static void clear(StringBuilder builder)
      Remove the content builder so it can be reused for a new string.
    • prettyPrintNestedCollections

      private static void prettyPrintNestedCollections(String indent, StringBuilder b, Collection<?> os)
      Append a human readable string representation of collection to b.
      Parameters:
      indent - an indent prepended to all appended lines
      b - a string builder on which result is appended
      os - the collection to be pretty printed
    • prettyPrintNestedCollections

      public static String prettyPrintNestedCollections(Collection<?> collection)
      Returns a human readable string representation of collection.
    • clamp

      public static String clamp(int maxlen, String s)