use string range information in has_prefix and has_suffix