I would like to know how to make a quick comparison between two chains to know if they share at least 1 character in common.
Example:
I have manzana
and piña
. In this case there is a coincidence. The a
is present in both. Therefore, I want the code to recognize if there is at least 1 match between both chains.
About this code, I do not know how I would implement it:
public static void Main(string[] args)
{
Console.WriteLine(ExisteCoincidencia("manzana", "piña")); //Debería ser True
Console.WriteLine(ExisteCoincidencia("no", "piña")); //Debería ser False
}
private static bool ExisteCoincidencia(string s1, string s2)
{
// ¿de qué forma podría lograrlo?
}