Class TextareaStringListUtility


  • public class TextareaStringListUtility
    extends Object
    Utility Class to work with a list of strings in a textarea. Strings are written in each line of a textarea. Each line must be ended with new line codes (LF or CRLF). If there is a string after the last new line code, that string will be treated as a last string. white spaces are never trimmed. Here is a examples:
    How TextareaStringListUtility works
    textarea list of string
    a[LF]
    b[LF]
    c[LF]
    "a", "b", "c"
    a[LF]
    b[LF]
    c[LF]
    "a", "b", "c"
    a[LF]
    b[LF]
    c[LF]
    [LF]
    "a", "b", "c", ""
    [LF]
    ""
      (empty list)
    (null) (empty list)
    • Constructor Detail

      • TextareaStringListUtility

        public TextareaStringListUtility()
    • Method Detail

      • stringListFromTextarea

        public static List<String> stringListFromTextarea​(String choiceListText)
        Returns a list of string parsed from a input of textarea.
        Parameters:
        choiceListText - the input of a textarea
        Returns:
        a list of string.
      • textareaFromStringList

        public static String textareaFromStringList​(List<String> stringList)
        Join the list of strings into a text. Each string will end with LF.
        Parameters:
        stringList - a list of strings to join.
        Returns:
        a text the strings joined.