/*Clay Warlick
Write a function f(a, b) which takes two character string
arguments and returns a string containing only the characters
found in both strings.
-LINQ Intersect appears to be best solution
*/
using System;
using System.Linq;
public class Program
{
public static void Main()
string text1 = "34567abb";
string text2 = "3abcb";
Console.WriteLine(compareChars(text1,text2));
}
// output = 3ab
public static string compareChars(string x, string y)
return new string(x.Intersect(y).ToArray());