Help me out

How to know whether a character is present in two different words or not?
Like “o” is present in both words “boy” and “toy”.How will I print it.