consolidated from_str_equiv with from_slice