帮我检查字符串 - 邮件地址 [英] Help me check String -- mail address
问题描述
在java中我想检查一个字符串作为邮件
我已经完成但我认为这不是真的
< java中的blockquote class =post_quotes>
我想检查一个字符串作为邮件
我已经完成但我认为这不是真的
使用代码标签发布您目前使用的代码。
还有一件事你知道正则表达式。
看看这个并尝试它使用正则表达式。
记住它,Reg Exp。在J2SE-1.5中支持:-)
亲切的问候,
Dmjpro。
发布你的代码到目前为止你用代码标签尝试了什么。
还有一件事你知道正则表达式。
看看这个并尝试它使用正则表达式。
记住它,Reg Exp。在J2SE-1.5中支持:-)
亲切的问候,
Dmjpro。
class StringDemo {
public static boolean isEmailAddress(String address){
int dot,at;
dot = address.indexOf("。");
at = address.indexOf(" @");
if (at == - 1 || dot == - 1 || address.length()< dot ||(dot< at)&&)返回false;
else返回true;
}
public static void main(String [] arg){
系统。 out.println(isEmailAddress(" lenguye .. @"));
}
}
但是如果@ i之前的字符串conatin点不能处理
帮助我!这个问题我认为你并不困难
谢谢
in java I want to check A String as mail
I have done but i think itisn''t true
in java I want to check A String as mail
I have done but i think itisn''t truePost your Code what you tried so far with Code Tags.
One more thing do you know regular expression.
Have a look at this and try it using Regular Expression.
Mind it, Reg Exp. supported in J2SE-1.5 :-)
Kind regards,
Dmjpro.
Post your Code what you tried so far with Code Tags.
One more thing do you know regular expression.
Have a look at this and try it using Regular Expression.
Mind it, Reg Exp. supported in J2SE-1.5 :-)
Kind regards,
Dmjpro.class StringDemo{
public static boolean isEmailAddress(String address) {
int dot,at;
dot = address.indexOf(".");
at = address.indexOf("@");
if( at ==-1 ||dot==-1|| address.length()< dot||(dot<at)&&) return false;
else return true;
}
public static void main( String[] arg){
System.out.println(isEmailAddress("lenguye..@"));
}
}
but if string conatin dot before @ i can''t process
help me !! this probelem i think it isn''t difficult to you
thanks
这篇关于帮我检查字符串 - 邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!