I have an ArrayList with values like \"abcd#xyz\" and \"mnop#qrs\". I want to convert it into an Array and then split it with # as delimiter and have abcd,mnop in an array a
This can be done using stream:
List stringList = Arrays.asList("abc#bcd", "mno#pqr");
List objects = stringList.stream()
.map(s -> s.split("#"))
.collect(Collectors.toList());
The return value would be arrays of split string. This avoids converting the arraylist to an array and performing the operation.