String comparison with n characters