I have arraylist of strings, I need to find the substrings among the items in same arraylist?
For example:
ArrayList<String> ar = new ArrayList();
ar.add("UserId"); //adding item to arraylist
ar.add("Directory");
ar.add("Username");
ar.add("PhoneNumber");
Here I want to find substring of items, basically I need output as UserId and Username from the list items. how can I do it can someone help me out.