There are a couple of ways of doing it.

The most efficient way is to iterate through all of the the user's and all-user's icons and collect all the paths together in a single string.

Once you have created the string you can then check if your substring is present.