StringMathCalculator/Calculator.cs
/// <summary>
/// Checks if a character exists in the wordReplacements Dictionary.
/// </summary>
/// <param name="character">Character to be checked for.</param>
/// <returns>Bool for if character exists in wordReplacements</returns>
Checks if a character exists in the wordReplacements Dictionary.
Checks if a character exists in the wordReplacements Dictionary .
private bool WordReplacementsContains(char character)
        {
            if (wordReplacements.ContainsKey(character))
            {
                string word = wordReplacements[character];
                CalculatorOperation operation = singleCharOperations[character];
                wordReplacements.Remove(character);
                singleCharOperations.Remove(character);
                var newChar = AddUnusedCharacter(word, character + 1);
                singleCharOperations.Add(newChar, operation);
                return true;
            }
            return false;
        }
private bool WordReplacementsContains ( char character ) { if ( wordReplacements . ContainsKey ( character ) ) { string word = wordReplacements [ character ] ; CalculatorOperation operation = singleCharOperations [ character ] ; wordReplacements . Remove ( character ) ; singleCharOperations . Remove ( character ) ; var newChar = AddUnusedCharacter ( word , character + 1 ) ; singleCharOperations . Add ( newChar , operation ) ; return true ; } return false ; }
Checks if a character exists in the wordReplacements Dictionary.
Checks if a character exists in the wordReplacements Dictionary .
Bool for if character exists in wordReplacements
Bool for if character exists in wordReplacements
character
char
Character to be checked for.
Character to be checked for .