String str = "Hello,World,How,Are,You?"; String[] strArray = StringUtils.split(str, ","); System.out.println(Arrays.toString(strArray));
String str = "Life is about creating and living experiences that are worth sharing"; String[] strArray = StringUtils.split(str, " "); System.out.println(Arrays.toString(strArray));Output: [Life, is, about, creating, and, living, experiences, that, are, worth, sharing] In this example, the string `str` is split into an array of substrings using a space as the delimiter. The resulting array is printed to the console. Overall, the StringUtils split method is a useful tool for splitting strings into arrays of substrings, making it easier to process or manipulate them in Java.