refactor: string usage
Created by: FineFindus
Improves https://github.com/fkinoshita/Wildcard/commit/6770e75f60a88346330365cf44af3281cdacd933, by using the str
directly without replacing it first.
Also replaces the earlier length check with the more idiomatic is_empty()
.