Class StringUtils


  • public class StringUtils
    extends java.lang.Object
    Utility class for Strings.
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String max​(java.lang.String string, int max)
      Returns the given string, with a maximum of max characters.
      static java.lang.String toCamelCase​(java.lang.String string)
      Converts a string to camelcase.
      • Methods inherited from class java.lang.Object

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

      • StringUtils

        public StringUtils()
    • Method Detail

      • toCamelCase

        public static java.lang.String toCamelCase​(java.lang.String string)
        Converts a string to camelcase. toCamelCase(null) : "" toCamelCase("hello") : "hello" toCamelCase("my name is Remy") : "myNameIsRemy" toCamelCase("I am FINE") : "iAmFine" toCamelCase(" "): ""
        Parameters:
        string - the input string
        Returns:
        camelcase representation of the given string
      • max

        public static java.lang.String max​(java.lang.String string,
                                           int max)
        Returns the given string, with a maximum of max characters. Characters after the max will be stripped.
        Parameters:
        string - the input string
        max - the maximum allowed length of the output string
        Returns:
        stripped string