I am studying JAVA and I have a question about Sorting string.
In the String ArrayList We have string value STRUCTURE is "0" + " " + "some string"
for example,
| String
| 0 AA
| 1 BB
| 2 AA
| 3 AA
| 4 CC
| 5 BB
and
when we sort it, result should be
| String
| 0 AA
| 2 AA
| 3 AA
| 1 BB
| 5 BB
| 4 CC
how can I sort the String with "number string" + " " + " String"
thanks
update:
i tested code blow with
1 AA
2 AA
3 BBB
4 CC
5 BBB
6 AA
7 BBB
8 CC
9 ZZZ
10 QQQ
and I got
0 AA
1 AA
5 AA
4 BBB
2 BBB
6 BBB
3 CC
7 CC
9 QQQ
8 ZZZ