StringMathCalculator/Calculator.cs
/// <summary>
/// Find an unused character, starting from unicode 161.
/// </summary>
/// <param name="word">Word to be added to wordReplacements Dictionary.</param>
/// <param name="startPoint">Unicode starting point, default is 161.</param>
/// <returns>The found unused character.</returns>
Find an unused character, starting from unicode 161.
Find an unused character starting from unicode 161 .
private char AddUnusedCharacter(string word, int startPoint = 161)
        {
            char replacement = (char)startPoint;
            if(singleCharOperations.ContainsKey(replacement))
            {
                for (int i = 0; i < 1023; i++)
                {
                    replacement++;
                    if(!singleCharOperations.ContainsKey(replacement))
                    {
                        break;
                    }
                }
            }
            legalCharacters.Append(replacement);
            wordReplacements.Add(replacement, word);
            return replacement;
        }
private char AddUnusedCharacter ( string word , int startPoint = 161 ) { char replacement = ( char ) startPoint ; if ( singleCharOperations . ContainsKey ( replacement ) ) { for ( int i = 0 ; i < 1023 ; i ++ ) { replacement ++ ; if ( ! singleCharOperations . ContainsKey ( replacement ) ) { break ; } } } legalCharacters . Append ( replacement ) ; wordReplacements . Add ( replacement , word ) ; return replacement ; }
Find an unused character, starting from unicode 161.
Find an unused character starting from unicode 161 .
The found unused character.
The found unused character .
word
string
Word to be added to wordReplacements Dictionary.
Word to be added to wordReplacements Dictionary .
startPoint
int
Unicode starting point, default is 161.
Unicode starting point default is 161 .