验证电子邮件地址是否包含“@”和“。” [英] validate that an email address contains "@" and "."
本文介绍了验证电子邮件地址是否包含“@”和“。”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要验证插入的电子邮件地址是否包含@和。没有正则表达式。
有人可以给我java代码和结构图的例子吗?
i need to validate that an inserted email address contains "@" and "." without a regular expression. Can somebody to give me "java code" and "structure chart" examples please?
推荐答案
我嫌疑人你有这样的事情:
if (!address.contains("@") || !address.contains("."))
{
// Handle bad address
}
编辑:当然,这远远不是一个完整的验证。这几乎不是验证的开始,但希望这将使您能够处理您想要处理的特定情况。
This is far from a complete validation, of course. It's barely even the start of validation - but hopefully this will get you going with the particular case you wanted to handle.
这篇关于验证电子邮件地址是否包含“@”和“。”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文