Alpha's Tech Space

一个关于软件开发的技术交流空间,希望和大家共同进步!(.net/C/C++/Java)

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
要求:不使用正则表达式等,只依赖基本的字符串操作,在一个字符串数组中检查电话号码和URL。
 Vector  text (its elements are String) 

eg:  "Hello, nice to meet you. Welcome to"               text.elementAt(0)
      "contact with us , our telephone is +86"              text.elementAt(1)
      "1084848888 and homepage is http://"               text.elementAt(2)
      "www.abc.com.cn. do you got it ?"                      text.elementAt(3)

程序需要正确的识别出+861084848888 这个电话号码和 www.abc.com.cn 这个URL.并且要能够记录它们在字符串中的位置,并计算在哪一行。

看上去不是很困难。但是写的好也不容易。

感兴趣的朋友动动脑筋吧。


posted on 2006-04-19 17:00  Lexrate  阅读(305)  评论(0编辑  收藏  举报