I am wondering how to achieve the following.
"t12345-g1234-o1234"
I have a line that contains multiple fields delimited by an hyphen and the field is formed by its identifier(first letter) and value.
How can I achieve an Map like the one below using java 8 streams.
{"t","12345"} , {"g","1234"}, {"o","1234"}
EDIT
I have tried the following, but I don't understand how to grab the substring information.
Arrays.stream(line.split("-"))
.collect(Collectors.toMap(String::substring(0,1),String::substring(1));