I have a list of Java String phone number & I need to sort out them based on their operator like - "013..." and "017..." they are both same operator number.
List<String> phoneNumberList = new ArrayList<String>();
phoneNumberList.add("01313445566");
phoneNumberList.add("01414556677");
phoneNumberList.add("01515667788");
phoneNumberList.add("01616778899");
phoneNumberList.add("01717889900");
phoneNumberList.add("01818990011");
phoneNumberList.add("01919001122");
When I print them, they look like -
01313445566
01414556677
01515667788
01616778899
01717889900
01818990011
01919001122
But I want to print them like this using custom order -
01313445566,
01717889900,
01414556677,
01919001122,
01515667788,
01616778899,
01818990011
How may I create a custom order to sort them as per my requirement?