Class Newlines


  • public final class Newlines
    extends java.lang.Object
    This type exposes helper methods that will help defend against newline-based attacks.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String stripAll​(java.lang.Object value)
      Removes newlines from the given string, if any exist.
      static java.lang.String stripAll​(java.lang.String value)
      Removes newlines from the given string, if any exist.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • stripAll

        public static java.lang.String stripAll​(java.lang.String value)
        Removes newlines from the given string, if any exist.
        Parameters:
        value - the given string to sanitize
        Returns:
        a String identical to the one given, without newline characters
      • stripAll

        public static java.lang.String stripAll​(java.lang.Object value)
        Removes newlines from the given string, if any exist.
        Parameters:
        value - the given string to sanitize
        Returns:
        a String identical to the one given, without newline characters