心情 天空

 




 










访




R
S
S

我的 Blog:
jybbh 最新的 20 条日志
[Ken的日志]
[工作心得]
[编程相关]
[潮汕文化]
[计算机相关]
[WEB相关]
[JAVA相关]
[Eclipse相关]
[Tomcat相关]
[SQL]
全站 Blog:
全站最新的 20 条日志

StringTokenizer

   编程相关2005-5-23 21:54
StringTokenizer fenxi=new StringTokenizer(strEmail,"@");

int n=fenxi.countTokens();

如果strEmail中包含有@,而且不是最前一个字符或最后一个字符
则,n为,意味着,@把strEmail分成了两个部分

如果有几个@连在一起,则也视为一个@
如test@@test.com
n的值为2
下面是几个例子,实践得出的
@test
n=1
-----
test@
n=1
-----
te@st
n=2
-----
te@@st
n=2
-----
t@e@s@t
n=4


Ken 2005-05-23 22:00
标签集:TAGS:
回复Comments()点击Count()

回复Comments

{commenttime}{commentauthor}

{CommentUrl}
{commentcontent}
 

Copyright 2004 酷酷小家园   Powered by 5dblog