lib: fix a bug with String::has_substring and related methods