@ NullSafe @ SuppressWarnings ( "all" ) public static String [ ] toStringArray ( String delimitedValue , String delimiter ) { return ArrayUtils . transform ( ObjectUtils . defaultIfNull ( delimitedValue , EMPTY_STRING ) . split ( defaultIfBlank ( delimiter , COMMA_DELIMITER ) ) , StringUtils :: trim ) ; }
Tokenizes the given delimited String into an array of individually trimmed Strings . If String is blank empty or null then a 0 length String array is returned . If the String is not delimited with the specified delimiter then a String array of size 1 is returned with the given String value as the only element .