Hi
you could split each string into an array as such, then check the counts of each array. Then check the counts to see which one is greater something has been changed in terms of length of words.
class Program
{
static void Main(string[] args)
{
Console.WriteLine(string.Join(", ",Program.getDifferences("MY STRING IS GREAT", "MY STRING IS AWESOME")));
Console.WriteLine(string.Join(", ", Program.getDifferences("MY STRING IS GREAT", "MY STR1NG IS GR3AT")));
Console.ReadKey();
}
public static List<string> getDifferences(string StartString, string EndString)
{
IEnumerable<string> startStringSet = StartString.Split(' ');
IEnumerable<string> endStringSet = EndString.Split(' ');
if (StartString.Count() == 0 && endStringSet.Count() == 0)
{
return new List<string>();
}
else if (startStringSet.Count() < endStringSet.Count())
{
return endStringSet.Except(startStringSet).ToList();
}
else
{
return endStringSet.Except(startStringSet).ToList();
}
}
}
Output Is:
AWESOME
STR1NG, GR3AT
Hope it helps
Regards
Dave