how to use contains with substring : i have an `ArryList` which have (name+"\n"+phoneNumber) so I wanna see if the name is containing with the list ? I used this code
`HashSet<String> set = new HashSet<String>(ContactsList);
if (set.contains(name))
{}
else
{
ContactsList.add(name+"\n"+phoneNumber+"\n");
}`
but how to use substring in contains so I get just the name from it to contain it with the name that I wanna add It to the list
and thanks