Searches the string for a substring, and returns index into this string of the first found instance. Can search from beginning or end, and ignore case or not. If substring is empty, returns clamped StartPosition.