[Solved] Check string for all letters in another string without repeating C# [closed]


string startingWord = "someword";
string checkWord = "door";

List<char> list = startingWord.ToList();

int score = 0;

for (int i = 0; i < checkWord.Length; i++)
{
    if (list.Any(c => c == checkWord[i])
    {
        score++;
        list.RemoveAt(list.FirstIndex(c => c == checkWord[I]));
    }
}

bool match = score == checkWord.Length;

1

solved Check string for all letters in another string without repeating C# [closed]