Extract `strip_spaces` method
Strip leading and trailing spaces out of a string in `check_word`