检查密码字段和验证密码字段是否不相等?
我正在开发的应用程序上有一份注册表。您输入您的电子邮件,然后输入您想要的密码和验证密码。它需要检查两个密码字段passwordFieldOne
和passwordFieldTwo
是否不相等。他们需要检查它们是否不相等,以便我的错误过程正常工作。这是我尝试过的一些事情。
if(passwordFieldOne != passwordFieldTwo){
//do whatever
}
-
if(passwordFieldOne.text != passwordFieldTwo.text){
//do whatever
}
-
if((passwordFieldOne.text == passwordFieldTwo.text) == False){
//do whatever
}
PS。请不要回复告诉我我可以只检查它们是否相等,或者检查它们是否相等然后说其他。感谢您的帮助。
I have a registration form on an app im working on. You enter your email then your desired password and a verify password. It needs to check if the two password fieldspasswordFieldOne
and passwordFieldTwo
and not equal. They need to check if they are not equal for my error process to work correctly. Here are some things I tried.
if(passwordFieldOne != passwordFieldTwo){
//do whatever
}
-
if(passwordFieldOne.text != passwordFieldTwo.text){
//do whatever
}
-
if((passwordFieldOne.text == passwordFieldTwo.text) == False){
//do whatever
}
PS. Please dont respond telling me I can just check if they are equal, or check if they are equal and then say else. Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用
isEqualToString:
方法比较字符串:Use
isEqualToString:
method for comparing strings:下面是比较 _passwordText 和 _confirmPasswordText 的代码
You below code of comparing _passwordText and _confirmPasswordText