Class Strings


  • public class Strings
    extends java.lang.Object
    Various String related utility methods, written mostly to avoid generation of new String objects (e.g. via splitting Strings etc).
    Since:
    3.6
    • Constructor Summary

      Constructors 
      Constructor Description
      Strings()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> split​(java.lang.String pattern, char slash)
      Splits given string to substrings by given separator
      static java.lang.String stripTrailing​(java.lang.String pattern, char c)  
      • Methods inherited from class java.lang.Object

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

      • Strings

        public Strings()
    • Method Detail

      • stripTrailing

        public static java.lang.String stripTrailing​(java.lang.String pattern,
                                                     char c)
        Parameters:
        pattern - non null
        c - character to remove
        Returns:
        new string with all trailing characters removed
      • split

        public static java.util.List<java.lang.String> split​(java.lang.String pattern,
                                                             char slash)
        Splits given string to substrings by given separator
        Parameters:
        pattern - non null
        slash - separator char
        Returns:
        list of substrings