Handle "begins with" and "contains" for strings.