Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    Utility class for string manipulation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String @NotNull [] splitFields​(@NotNull java.lang.String line)
      Splits a line into tokens.
      static @NotNull java.lang.String trimLeading​(@NotNull java.lang.CharSequence str)
      Removes leading whitespace from a string.
      • Methods inherited from class java.lang.Object

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

      • trimLeading

        @NotNull
        public static @NotNull java.lang.String trimLeading​(@NotNull
                                                            @NotNull java.lang.CharSequence str)
        Removes leading whitespace from a string.
        Parameters:
        str - the string
        Returns:
        the string without leading whitespace
      • splitFields

        @NotNull
        public static @NotNull java.lang.String @NotNull [] splitFields​(@NotNull
                                                                        @NotNull java.lang.String line)
                                                                 throws UnterminatedTokenException
        Splits a line into tokens. Handles quoting ("...").
        Parameters:
        line - the line
        Returns:
        the tokens
        Throws:
        UnterminatedTokenException - if a quoted token is unterminated