I have string:
String s = #Jay125,150012 90,#Jay222,150043 00,
- I want to filter out value after jay(125,222) and add that to separate
ArrayList. - I want to filter out 150012, 151243 together add that to separate
ArrayList. - I want to filter out 90,00 together add that to separate
ArrayList.
I tried by doing this but it doesn't quite do what I want
Pattern reg = Pattern.compile(",");
ArrayList<String> jay = reg.splitAsStream(s))
.filter(role -> role.contains("Jay"))
.map(String::trim)
.collect(Collectors.toCollection(ArrayList::new));