Class Strings


  • public final class Strings
    extends java.lang.Object

    Expression Object for performing String-related operations inside Thymeleaf Standard Expressions.

    An object of this class is usually available in variable evaluation expressions with the name #strings.

    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Locale locale  
    • Constructor Summary

      Constructors 
      Constructor Description
      Strings​(java.util.Locale locale)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String abbreviate​(java.lang.Object target, int maxSize)  
      java.lang.String append​(java.lang.Object target, java.lang.String suffix)  
      java.lang.String[] arrayAbbreviate​(java.lang.Object[] target, int maxSize)  
      java.lang.String[] arrayAppend​(java.lang.Object[] target, java.lang.String suffix)  
      java.lang.String[] arrayCapitalize​(java.lang.Object[] target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.
      java.lang.String[] arrayCapitalizeWords​(java.lang.Object[] target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
      java.lang.String[] arrayCapitalizeWords​(java.lang.Object[] target, java.lang.Object delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
      java.lang.Boolean[] arrayContains​(java.lang.Object[] target, java.lang.String fragment)  
      java.lang.Boolean[] arrayContainsIgnoreCase​(java.lang.Object[] target, java.lang.String fragment)  
      java.lang.String[] arrayDefaultString​(java.lang.Object[] target, java.lang.Object defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      java.lang.Boolean[] arrayEndsWith​(java.lang.Object[] target, java.lang.String suffix)  
      java.lang.String[] arrayEscapeJava​(java.lang.Object[] target)
      Java-escapes all the elements in the target array.
      java.lang.String[] arrayEscapeJavaScript​(java.lang.Object[] target)
      JavaScript-escapes all the elements in the target array.
      java.lang.String[] arrayEscapeXml​(java.lang.Object[] target)
      XML-escapes all the elements in the target array.
      java.lang.Integer[] arrayIndexOf​(java.lang.Object[] target, java.lang.String fragment)  
      java.lang.Boolean[] arrayIsEmpty​(java.lang.Object[] target)  
      java.lang.String arrayJoin​(java.lang.Object[] stringArray, java.lang.String separator)  
      java.lang.Integer[] arrayLength​(java.lang.Object[] target)  
      java.lang.String[] arrayMultipleReplace​(java.lang.Object[] target, java.lang.String[] before, java.lang.String[] after)  
      java.lang.String[] arrayPrepend​(java.lang.Object[] target, java.lang.String prefix)  
      java.lang.String[] arrayReplace​(java.lang.Object[] target, java.lang.String before, java.lang.String after)  
      java.lang.String[] arraySplit​(java.lang.Object target, java.lang.String separator)  
      java.lang.Boolean[] arrayStartsWith​(java.lang.Object[] target, java.lang.String prefix)  
      java.lang.String[] arraySubstring​(java.lang.Object[] target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target array.
      java.lang.String[] arraySubstring​(java.lang.Object[] target, int start, int end)  
      java.lang.String[] arraySubstringAfter​(java.lang.Object[] target, java.lang.String substr)  
      java.lang.String[] arraySubstringBefore​(java.lang.Object[] target, java.lang.String substr)  
      java.lang.String[] arrayToLowerCase​(java.lang.Object[] target)  
      java.lang.String[] arrayToString​(java.lang.Object[] target)
      Performs a null-safe toString() operation on each element of the array.
      java.lang.String[] arrayToUpperCase​(java.lang.Object[] target)  
      java.lang.String[] arrayTrim​(java.lang.Object[] target)  
      java.lang.String[] arrayUnCapitalize​(java.lang.Object[] target)
      Convert the first letter into lowercase for all the elements in the target array.
      java.lang.String[] arrayUnescapeJava​(java.lang.Object[] target)
      Java-unescapes all the elements in the target array.
      java.lang.String[] arrayUnescapeJavaScript​(java.lang.Object[] target)
      JavaScript-unescapes all the elements in the target array.
      java.lang.String capitalize​(java.lang.Object target)
      Convert the first letter of target to uppercase (title-case, in fact).
      java.lang.String capitalizeWords​(java.lang.Object target)
      Convert the first letter of each words of target to uppercase (title-case, in fact).
      java.lang.String capitalizeWords​(java.lang.Object target, java.lang.Object delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.
      java.lang.String concat​(java.lang.Object... values)  
      java.lang.String concatReplaceNulls​(java.lang.String nullValue, java.lang.Object... values)  
      java.lang.Boolean contains​(java.lang.Object target, java.lang.String fragment)  
      java.lang.Boolean containsIgnoreCase​(java.lang.Object target, java.lang.String fragment)  
      java.lang.String defaultString​(java.lang.Object target, java.lang.Object defaultValue)
      Checks if target text is empty and uses either target, or if the target is empty uses defaultValue.
      java.lang.Boolean endsWith​(java.lang.Object target, java.lang.String suffix)  
      java.lang.Boolean equals​(java.lang.Object first, java.lang.Object second)  
      java.lang.Boolean equalsIgnoreCase​(java.lang.Object first, java.lang.Object second)  
      java.lang.String escapeJava​(java.lang.Object target)
      Java-escapes the specified text.
      java.lang.String escapeJavaScript​(java.lang.Object target)
      JavaScript-escapes the specified text.
      java.lang.String escapeXml​(java.lang.Object target)
      XML-escapes the specified text.
      java.lang.Integer indexOf​(java.lang.Object target, java.lang.String fragment)  
      java.lang.Boolean isEmpty​(java.lang.Object target)  
      java.lang.Integer length​(java.lang.Object target)  
      java.util.List<java.lang.String> listAbbreviate​(java.util.List<?> target, int maxSize)  
      java.util.List<java.lang.String> listAppend​(java.util.List<?> target, java.lang.String suffix)  
      java.util.List<java.lang.String> listCapitalize​(java.util.List<?> target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.
      java.util.List<java.lang.String> listCapitalizeWords​(java.util.List<?> target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
      java.util.List<java.lang.String> listCapitalizeWords​(java.util.List<?> target, java.lang.Object delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
      java.util.List<java.lang.Boolean> listContains​(java.util.List<?> target, java.lang.String fragment)  
      java.util.List<java.lang.Boolean> listContainsIgnoreCase​(java.util.List<?> target, java.lang.String fragment)  
      java.util.List<java.lang.String> listDefaultString​(java.util.List<?> target, java.lang.Object defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      java.util.List<java.lang.Boolean> listEndsWith​(java.util.List<?> target, java.lang.String suffix)  
      java.util.List<java.lang.String> listEscapeJava​(java.util.List<?> target)
      Java-escapes all the elements in the target list.
      java.util.List<java.lang.String> listEscapeJavaScript​(java.util.List<?> target)
      JavaScript-escapes all the elements in the target list.
      java.util.List<java.lang.String> listEscapeXml​(java.util.List<?> target)
      XML-escapes all the elements in the target list.
      java.util.List<java.lang.Integer> listIndexOf​(java.util.List<?> target, java.lang.String fragment)  
      java.util.List<java.lang.Boolean> listIsEmpty​(java.util.List<?> target)  
      java.lang.String listJoin​(java.util.List<?> stringIter, java.lang.String separator)  
      java.util.List<java.lang.Integer> listLength​(java.util.List<?> target)  
      java.util.List<java.lang.String> listMultipleReplace​(java.util.List<?> target, java.lang.String[] before, java.lang.String[] after)  
      java.util.List<java.lang.String> listPrepend​(java.util.List<?> target, java.lang.String prefix)  
      java.util.List<java.lang.String> listReplace​(java.util.List<?> target, java.lang.String before, java.lang.String after)  
      java.util.List<java.lang.String> listSplit​(java.lang.Object target, java.lang.String separator)  
      java.util.List<java.lang.Boolean> listStartsWith​(java.util.List<?> target, java.lang.String prefix)  
      java.util.List<java.lang.String> listSubstring​(java.util.List<?> target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target list.
      java.util.List<java.lang.String> listSubstring​(java.util.List<?> target, int start, int end)  
      java.util.List<java.lang.String> listSubstringAfter​(java.util.List<?> target, java.lang.String substr)  
      java.util.List<java.lang.String> listSubstringBefore​(java.util.List<?> target, java.lang.String substr)  
      java.util.List<java.lang.String> listToLowerCase​(java.util.List<?> target)  
      java.util.List<java.lang.String> listToString​(java.util.List<?> target)
      Performs a null-safe toString() operation on each element of the list.
      java.util.List<java.lang.String> listToUpperCase​(java.util.List<?> target)  
      java.util.List<java.lang.String> listTrim​(java.util.List<?> target)  
      java.util.List<java.lang.String> listUnCapitalize​(java.util.List<?> target)
      Convert the first letter into lowercase for all the elements in the target list.
      java.util.List<java.lang.String> listUnescapeJava​(java.util.List<?> target)
      Java-unescapes all the elements in the target list.
      java.util.List<java.lang.String> listUnescapeJavaScript​(java.util.List<?> target)
      JavaScript-unescapes all the elements in the target list.
      java.lang.String multipleReplace​(java.lang.Object target, java.lang.String[] before, java.lang.String[] after)  
      java.lang.String prepend​(java.lang.Object target, java.lang.String prefix)  
      java.lang.String randomAlphanumeric​(int count)
      Builds a random String using characters 0..9 and A..Z.
      java.lang.String repeat​(java.lang.Object target, int times)  
      java.lang.String replace​(java.lang.Object target, java.lang.String before, java.lang.String after)  
      java.util.Set<java.lang.String> setAbbreviate​(java.util.Set<?> target, int maxSize)  
      java.util.Set<java.lang.String> setAppend​(java.util.Set<?> target, java.lang.String suffix)  
      java.util.Set<java.lang.String> setCapitalize​(java.util.Set<?> target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.
      java.util.Set<java.lang.String> setCapitalizeWords​(java.util.Set<?> target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
      java.util.Set<java.lang.String> setCapitalizeWords​(java.util.Set<?> target, java.lang.Object delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
      java.util.Set<java.lang.Boolean> setContains​(java.util.Set<?> target, java.lang.String fragment)  
      java.util.Set<java.lang.Boolean> setContainsIgnoreCase​(java.util.Set<?> target, java.lang.String fragment)  
      java.util.Set<java.lang.String> setDefaultString​(java.util.Set<?> target, java.lang.Object defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      java.util.Set<java.lang.Boolean> setEndsWith​(java.util.Set<?> target, java.lang.String suffix)  
      java.util.Set<java.lang.String> setEscapeJava​(java.util.Set<?> target)
      Java-escapes all the elements in the target set.
      java.util.Set<java.lang.String> setEscapeJavaScript​(java.util.Set<?> target)
      JavaScript-escapes all the elements in the target set.
      java.util.Set<java.lang.String> setEscapeXml​(java.util.Set<?> target)
      XML-escapes all the elements in the target set.
      java.util.Set<java.lang.Integer> setIndexOf​(java.util.Set<?> target, java.lang.String fragment)  
      java.util.Set<java.lang.Boolean> setIsEmpty​(java.util.Set<?> target)  
      java.lang.String setJoin​(java.util.Set<?> stringIter, java.lang.String separator)  
      java.util.Set<java.lang.Integer> setLength​(java.util.Set<?> target)  
      java.util.Set<java.lang.String> setMultipleReplace​(java.util.Set<?> target, java.lang.String[] before, java.lang.String[] after)  
      java.util.Set<java.lang.String> setPrepend​(java.util.Set<?> target, java.lang.String prefix)  
      java.util.Set<java.lang.String> setReplace​(java.util.Set<?> target, java.lang.String before, java.lang.String after)  
      java.util.Set<java.lang.String> setSplit​(java.lang.Object target, java.lang.String separator)  
      java.util.Set<java.lang.Boolean> setStartsWith​(java.util.Set<?> target, java.lang.String prefix)  
      java.util.Set<java.lang.String> setSubstring​(java.util.Set<?> target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target set.
      java.util.Set<java.lang.String> setSubstring​(java.util.Set<?> target, int start, int end)  
      java.util.Set<java.lang.String> setSubstringAfter​(java.util.Set<?> target, java.lang.String substr)  
      java.util.Set<java.lang.String> setSubstringBefore​(java.util.Set<?> target, java.lang.String substr)  
      java.util.Set<java.lang.String> setToLowerCase​(java.util.Set<?> target)  
      java.util.Set<java.lang.String> setToString​(java.util.Set<?> target)
      Performs a null-safe toString() operation on each element of the set.
      java.util.Set<java.lang.String> setToUpperCase​(java.util.Set<?> target)  
      java.util.Set<java.lang.String> setTrim​(java.util.Set<?> target)  
      java.util.Set<java.lang.String> setUnCapitalize​(java.util.Set<?> target)
      Convert the first letter into lowercase for all the elements in the target set.
      java.util.Set<java.lang.String> setUnescapeJava​(java.util.Set<?> target)
      Java-unescapes all the elements in the target set.
      java.util.Set<java.lang.String> setUnescapeJavaScript​(java.util.Set<?> target)
      JavaScript-unescapes all the elements in the target set.
      java.lang.Boolean startsWith​(java.lang.Object target, java.lang.String prefix)  
      java.lang.String substring​(java.lang.Object target, int start)
      copy a part of target start beginIndex to the end of target.
      java.lang.String substring​(java.lang.Object target, int start, int end)  
      java.lang.String substringAfter​(java.lang.Object target, java.lang.String substr)  
      java.lang.String substringBefore​(java.lang.Object target, java.lang.String substr)  
      java.lang.String toLowerCase​(java.lang.Object target)  
      java.lang.String toString​(java.lang.Object target)
      Performs a null-safe toString() operation.
      java.lang.String toUpperCase​(java.lang.Object target)  
      java.lang.String trim​(java.lang.Object target)  
      java.lang.String unCapitalize​(java.lang.Object target)
      Convert the first letter of target to lowercase.
      java.lang.String unescapeJava​(java.lang.Object target)
      Java-unescapes the specified text.
      java.lang.String unescapeJavaScript​(java.lang.Object target)
      JavaScript-unescapes the specified text.
      • Methods inherited from class java.lang.Object

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

      • locale

        private final java.util.Locale locale
    • Constructor Detail

      • Strings

        public Strings​(java.util.Locale locale)
    • Method Detail

      • toString

        public java.lang.String toString​(java.lang.Object target)

        Performs a null-safe toString() operation.

        Parameters:
        target - the object on which toString will be executed
        Returns:
        the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • arrayToString

        public java.lang.String[] arrayToString​(java.lang.Object[] target)

        Performs a null-safe toString() operation on each element of the array.

        Parameters:
        target - the array of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • listToString

        public java.util.List<java.lang.String> listToString​(java.util.List<?> target)

        Performs a null-safe toString() operation on each element of the list.

        Parameters:
        target - the list of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • setToString

        public java.util.Set<java.lang.String> setToString​(java.util.Set<?> target)

        Performs a null-safe toString() operation on each element of the set.

        Parameters:
        target - the set of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • abbreviate

        public java.lang.String abbreviate​(java.lang.Object target,
                                           int maxSize)
      • arrayAbbreviate

        public java.lang.String[] arrayAbbreviate​(java.lang.Object[] target,
                                                  int maxSize)
      • listAbbreviate

        public java.util.List<java.lang.String> listAbbreviate​(java.util.List<?> target,
                                                               int maxSize)
      • setAbbreviate

        public java.util.Set<java.lang.String> setAbbreviate​(java.util.Set<?> target,
                                                             int maxSize)
      • equals

        public java.lang.Boolean equals​(java.lang.Object first,
                                        java.lang.Object second)
        Parameters:
        first - first
        second - second
        Returns:
        the result
        Since:
        2.0.16
      • equalsIgnoreCase

        public java.lang.Boolean equalsIgnoreCase​(java.lang.Object first,
                                                  java.lang.Object second)
        Parameters:
        first - first
        second - second
        Returns:
        the result
        Since:
        2.0.16
      • contains

        public java.lang.Boolean contains​(java.lang.Object target,
                                          java.lang.String fragment)
      • arrayContains

        public java.lang.Boolean[] arrayContains​(java.lang.Object[] target,
                                                 java.lang.String fragment)
      • listContains

        public java.util.List<java.lang.Boolean> listContains​(java.util.List<?> target,
                                                              java.lang.String fragment)
      • setContains

        public java.util.Set<java.lang.Boolean> setContains​(java.util.Set<?> target,
                                                            java.lang.String fragment)
      • containsIgnoreCase

        public java.lang.Boolean containsIgnoreCase​(java.lang.Object target,
                                                    java.lang.String fragment)
      • arrayContainsIgnoreCase

        public java.lang.Boolean[] arrayContainsIgnoreCase​(java.lang.Object[] target,
                                                           java.lang.String fragment)
      • listContainsIgnoreCase

        public java.util.List<java.lang.Boolean> listContainsIgnoreCase​(java.util.List<?> target,
                                                                        java.lang.String fragment)
      • setContainsIgnoreCase

        public java.util.Set<java.lang.Boolean> setContainsIgnoreCase​(java.util.Set<?> target,
                                                                      java.lang.String fragment)
      • startsWith

        public java.lang.Boolean startsWith​(java.lang.Object target,
                                            java.lang.String prefix)
      • arrayStartsWith

        public java.lang.Boolean[] arrayStartsWith​(java.lang.Object[] target,
                                                   java.lang.String prefix)
      • listStartsWith

        public java.util.List<java.lang.Boolean> listStartsWith​(java.util.List<?> target,
                                                                java.lang.String prefix)
      • setStartsWith

        public java.util.Set<java.lang.Boolean> setStartsWith​(java.util.Set<?> target,
                                                              java.lang.String prefix)
      • endsWith

        public java.lang.Boolean endsWith​(java.lang.Object target,
                                          java.lang.String suffix)
      • arrayEndsWith

        public java.lang.Boolean[] arrayEndsWith​(java.lang.Object[] target,
                                                 java.lang.String suffix)
      • listEndsWith

        public java.util.List<java.lang.Boolean> listEndsWith​(java.util.List<?> target,
                                                              java.lang.String suffix)
      • setEndsWith

        public java.util.Set<java.lang.Boolean> setEndsWith​(java.util.Set<?> target,
                                                            java.lang.String suffix)
      • substring

        public java.lang.String substring​(java.lang.Object target,
                                          int start,
                                          int end)
      • arraySubstring

        public java.lang.String[] arraySubstring​(java.lang.Object[] target,
                                                 int start,
                                                 int end)
      • listSubstring

        public java.util.List<java.lang.String> listSubstring​(java.util.List<?> target,
                                                              int start,
                                                              int end)
      • setSubstring

        public java.util.Set<java.lang.String> setSubstring​(java.util.Set<?> target,
                                                            int start,
                                                            int end)
      • substring

        public java.lang.String substring​(java.lang.Object target,
                                          int start)

        copy a part of target start beginIndex to the end of target. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • arraySubstring

        public java.lang.String[] arraySubstring​(java.lang.Object[] target,
                                                 int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target array. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • listSubstring

        public java.util.List<java.lang.String> listSubstring​(java.util.List<?> target,
                                                              int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target list. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • setSubstring

        public java.util.Set<java.lang.String> setSubstring​(java.util.Set<?> target,
                                                            int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target set. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • substringAfter

        public java.lang.String substringAfter​(java.lang.Object target,
                                               java.lang.String substr)
      • arraySubstringAfter

        public java.lang.String[] arraySubstringAfter​(java.lang.Object[] target,
                                                      java.lang.String substr)
      • listSubstringAfter

        public java.util.List<java.lang.String> listSubstringAfter​(java.util.List<?> target,
                                                                   java.lang.String substr)
      • setSubstringAfter

        public java.util.Set<java.lang.String> setSubstringAfter​(java.util.Set<?> target,
                                                                 java.lang.String substr)
      • substringBefore

        public java.lang.String substringBefore​(java.lang.Object target,
                                                java.lang.String substr)
      • arraySubstringBefore

        public java.lang.String[] arraySubstringBefore​(java.lang.Object[] target,
                                                       java.lang.String substr)
      • listSubstringBefore

        public java.util.List<java.lang.String> listSubstringBefore​(java.util.List<?> target,
                                                                    java.lang.String substr)
      • setSubstringBefore

        public java.util.Set<java.lang.String> setSubstringBefore​(java.util.Set<?> target,
                                                                  java.lang.String substr)
      • prepend

        public java.lang.String prepend​(java.lang.Object target,
                                        java.lang.String prefix)
      • arrayPrepend

        public java.lang.String[] arrayPrepend​(java.lang.Object[] target,
                                               java.lang.String prefix)
      • listPrepend

        public java.util.List<java.lang.String> listPrepend​(java.util.List<?> target,
                                                            java.lang.String prefix)
      • setPrepend

        public java.util.Set<java.lang.String> setPrepend​(java.util.Set<?> target,
                                                          java.lang.String prefix)
      • repeat

        public java.lang.String repeat​(java.lang.Object target,
                                       int times)
        Parameters:
        target - target
        times - times
        Returns:
        the result
        Since:
        2.1.0
      • append

        public java.lang.String append​(java.lang.Object target,
                                       java.lang.String suffix)
      • concat

        public java.lang.String concat​(java.lang.Object... values)
        Parameters:
        values - values
        Returns:
        the result
        Since:
        2.0.16
      • concatReplaceNulls

        public java.lang.String concatReplaceNulls​(java.lang.String nullValue,
                                                   java.lang.Object... values)
        Parameters:
        nullValue - nullValue
        values - values
        Returns:
        the result
        Since:
        2.0.16
      • arrayAppend

        public java.lang.String[] arrayAppend​(java.lang.Object[] target,
                                              java.lang.String suffix)
      • listAppend

        public java.util.List<java.lang.String> listAppend​(java.util.List<?> target,
                                                           java.lang.String suffix)
      • setAppend

        public java.util.Set<java.lang.String> setAppend​(java.util.Set<?> target,
                                                         java.lang.String suffix)
      • indexOf

        public java.lang.Integer indexOf​(java.lang.Object target,
                                         java.lang.String fragment)
      • arrayIndexOf

        public java.lang.Integer[] arrayIndexOf​(java.lang.Object[] target,
                                                java.lang.String fragment)
      • listIndexOf

        public java.util.List<java.lang.Integer> listIndexOf​(java.util.List<?> target,
                                                             java.lang.String fragment)
      • setIndexOf

        public java.util.Set<java.lang.Integer> setIndexOf​(java.util.Set<?> target,
                                                           java.lang.String fragment)
      • isEmpty

        public java.lang.Boolean isEmpty​(java.lang.Object target)
      • arrayIsEmpty

        public java.lang.Boolean[] arrayIsEmpty​(java.lang.Object[] target)
      • listIsEmpty

        public java.util.List<java.lang.Boolean> listIsEmpty​(java.util.List<?> target)
      • setIsEmpty

        public java.util.Set<java.lang.Boolean> setIsEmpty​(java.util.Set<?> target)
      • arrayJoin

        public java.lang.String arrayJoin​(java.lang.Object[] stringArray,
                                          java.lang.String separator)
      • listJoin

        public java.lang.String listJoin​(java.util.List<?> stringIter,
                                         java.lang.String separator)
      • setJoin

        public java.lang.String setJoin​(java.util.Set<?> stringIter,
                                        java.lang.String separator)
      • arraySplit

        public java.lang.String[] arraySplit​(java.lang.Object target,
                                             java.lang.String separator)
      • listSplit

        public java.util.List<java.lang.String> listSplit​(java.lang.Object target,
                                                          java.lang.String separator)
      • setSplit

        public java.util.Set<java.lang.String> setSplit​(java.lang.Object target,
                                                        java.lang.String separator)
      • length

        public java.lang.Integer length​(java.lang.Object target)
      • arrayLength

        public java.lang.Integer[] arrayLength​(java.lang.Object[] target)
      • listLength

        public java.util.List<java.lang.Integer> listLength​(java.util.List<?> target)
      • setLength

        public java.util.Set<java.lang.Integer> setLength​(java.util.Set<?> target)
      • replace

        public java.lang.String replace​(java.lang.Object target,
                                        java.lang.String before,
                                        java.lang.String after)
      • arrayReplace

        public java.lang.String[] arrayReplace​(java.lang.Object[] target,
                                               java.lang.String before,
                                               java.lang.String after)
      • listReplace

        public java.util.List<java.lang.String> listReplace​(java.util.List<?> target,
                                                            java.lang.String before,
                                                            java.lang.String after)
      • setReplace

        public java.util.Set<java.lang.String> setReplace​(java.util.Set<?> target,
                                                          java.lang.String before,
                                                          java.lang.String after)
      • multipleReplace

        public java.lang.String multipleReplace​(java.lang.Object target,
                                                java.lang.String[] before,
                                                java.lang.String[] after)
      • arrayMultipleReplace

        public java.lang.String[] arrayMultipleReplace​(java.lang.Object[] target,
                                                       java.lang.String[] before,
                                                       java.lang.String[] after)
      • listMultipleReplace

        public java.util.List<java.lang.String> listMultipleReplace​(java.util.List<?> target,
                                                                    java.lang.String[] before,
                                                                    java.lang.String[] after)
      • setMultipleReplace

        public java.util.Set<java.lang.String> setMultipleReplace​(java.util.Set<?> target,
                                                                  java.lang.String[] before,
                                                                  java.lang.String[] after)
      • toUpperCase

        public java.lang.String toUpperCase​(java.lang.Object target)
      • arrayToUpperCase

        public java.lang.String[] arrayToUpperCase​(java.lang.Object[] target)
      • listToUpperCase

        public java.util.List<java.lang.String> listToUpperCase​(java.util.List<?> target)
      • setToUpperCase

        public java.util.Set<java.lang.String> setToUpperCase​(java.util.Set<?> target)
      • toLowerCase

        public java.lang.String toLowerCase​(java.lang.Object target)
      • arrayToLowerCase

        public java.lang.String[] arrayToLowerCase​(java.lang.Object[] target)
      • listToLowerCase

        public java.util.List<java.lang.String> listToLowerCase​(java.util.List<?> target)
      • setToLowerCase

        public java.util.Set<java.lang.String> setToLowerCase​(java.util.Set<?> target)
      • trim

        public java.lang.String trim​(java.lang.Object target)
      • arrayTrim

        public java.lang.String[] arrayTrim​(java.lang.Object[] target)
      • listTrim

        public java.util.List<java.lang.String> listTrim​(java.util.List<?> target)
      • setTrim

        public java.util.Set<java.lang.String> setTrim​(java.util.Set<?> target)
      • capitalize

        public java.lang.String capitalize​(java.lang.Object target)

        Convert the first letter of target to uppercase (title-case, in fact).

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalize

        public java.lang.String[] arrayCapitalize​(java.lang.Object[] target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalize

        public java.util.List<java.lang.String> listCapitalize​(java.util.List<?> target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalize

        public java.util.Set<java.lang.String> setCapitalize​(java.util.Set<?> target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • unCapitalize

        public java.lang.String unCapitalize​(java.lang.Object target)

        Convert the first letter of target to lowercase.

        Parameters:
        target - the String to be uncapitalized. If non-String object, toString() will be called.
        Returns:
        String the result of uncapitalizing the target.
        Since:
        1.1.2
      • arrayUnCapitalize

        public java.lang.String[] arrayUnCapitalize​(java.lang.Object[] target)

        Convert the first letter into lowercase for all the elements in the target array.

        Parameters:
        target - the array of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • listUnCapitalize

        public java.util.List<java.lang.String> listUnCapitalize​(java.util.List<?> target)

        Convert the first letter into lowercase for all the elements in the target list.

        Parameters:
        target - the list of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • setUnCapitalize

        public java.util.Set<java.lang.String> setUnCapitalize​(java.util.Set<?> target)

        Convert the first letter into lowercase for all the elements in the target set.

        Parameters:
        target - the set of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • capitalizeWords

        public java.lang.String capitalizeWords​(java.lang.Object target)

        Convert the first letter of each words of target to uppercase (title-case, in fact). The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalizeWords

        public java.lang.String[] arrayCapitalizeWords​(java.lang.Object[] target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalizeWords

        public java.util.List<java.lang.String> listCapitalizeWords​(java.util.List<?> target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalizeWords

        public java.util.Set<java.lang.String> setCapitalizeWords​(java.util.Set<?> target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • capitalizeWords

        public java.lang.String capitalizeWords​(java.lang.Object target,
                                                java.lang.Object delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalizeWords

        public java.lang.String[] arrayCapitalizeWords​(java.lang.Object[] target,
                                                       java.lang.Object delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalizeWords

        public java.util.List<java.lang.String> listCapitalizeWords​(java.util.List<?> target,
                                                                    java.lang.Object delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalizeWords

        public java.util.Set<java.lang.String> setCapitalizeWords​(java.util.Set<?> target,
                                                                  java.lang.Object delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString()
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • escapeXml

        public java.lang.String escapeXml​(java.lang.Object target)

        XML-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.9
      • arrayEscapeXml

        public java.lang.String[] arrayEscapeXml​(java.lang.Object[] target)

        XML-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.9
      • listEscapeXml

        public java.util.List<java.lang.String> listEscapeXml​(java.util.List<?> target)

        XML-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.9
      • setEscapeXml

        public java.util.Set<java.lang.String> setEscapeXml​(java.util.Set<?> target)

        XML-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.9
      • escapeJavaScript

        public java.lang.String escapeJavaScript​(java.lang.Object target)

        JavaScript-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.11
      • arrayEscapeJavaScript

        public java.lang.String[] arrayEscapeJavaScript​(java.lang.Object[] target)

        JavaScript-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listEscapeJavaScript

        public java.util.List<java.lang.String> listEscapeJavaScript​(java.util.List<?> target)

        JavaScript-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setEscapeJavaScript

        public java.util.Set<java.lang.String> setEscapeJavaScript​(java.util.Set<?> target)

        JavaScript-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • unescapeJavaScript

        public java.lang.String unescapeJavaScript​(java.lang.Object target)

        JavaScript-unescapes the specified text.

        Parameters:
        target - the text to be unescaped
        Returns:
        the unescaped text.
        Since:
        2.0.11
      • arrayUnescapeJavaScript

        public java.lang.String[] arrayUnescapeJavaScript​(java.lang.Object[] target)

        JavaScript-unescapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listUnescapeJavaScript

        public java.util.List<java.lang.String> listUnescapeJavaScript​(java.util.List<?> target)

        JavaScript-unescapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setUnescapeJavaScript

        public java.util.Set<java.lang.String> setUnescapeJavaScript​(java.util.Set<?> target)

        JavaScript-unescapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • escapeJava

        public java.lang.String escapeJava​(java.lang.Object target)

        Java-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.11
      • arrayEscapeJava

        public java.lang.String[] arrayEscapeJava​(java.lang.Object[] target)

        Java-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listEscapeJava

        public java.util.List<java.lang.String> listEscapeJava​(java.util.List<?> target)

        Java-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setEscapeJava

        public java.util.Set<java.lang.String> setEscapeJava​(java.util.Set<?> target)

        Java-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • unescapeJava

        public java.lang.String unescapeJava​(java.lang.Object target)

        Java-unescapes the specified text.

        Parameters:
        target - the text to be unescaped
        Returns:
        the unescaped text.
        Since:
        2.0.11
      • arrayUnescapeJava

        public java.lang.String[] arrayUnescapeJava​(java.lang.Object[] target)

        Java-unescapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listUnescapeJava

        public java.util.List<java.lang.String> listUnescapeJava​(java.util.List<?> target)

        Java-unescapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setUnescapeJava

        public java.util.Set<java.lang.String> setUnescapeJava​(java.util.Set<?> target)

        Java-unescapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • randomAlphanumeric

        public java.lang.String randomAlphanumeric​(int count)

        Builds a random String using characters 0..9 and A..Z.

        Parameters:
        count - length of the generated String
        Returns:
        a random String
        Since:
        2.1.0
      • defaultString

        public java.lang.String defaultString​(java.lang.Object target,
                                              java.lang.Object defaultValue)

        Checks if target text is empty and uses either target, or if the target is empty uses defaultValue.

        Parameters:
        target - value that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to use if target is empty If non-String objects, toString() will be called.
        Returns:
        either target, or if the target is empty defaultValue
        Since:
        2.1.3
      • arrayDefaultString

        public java.lang.String[] arrayDefaultString​(java.lang.Object[] target,
                                                     java.lang.Object defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the array of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3
      • listDefaultString

        public java.util.List<java.lang.String> listDefaultString​(java.util.List<?> target,
                                                                  java.lang.Object defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the list of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a List<String> with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3
      • setDefaultString

        public java.util.Set<java.lang.String> setDefaultString​(java.util.Set<?> target,
                                                                java.lang.Object defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the set of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a Set<String> with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3