惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
博客园 - Franky
GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
Scott Helme
Scott Helme
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
C
CERT Recently Published Vulnerability Notes
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
L
LangChain Blog
L
LINUX DO - 最新话题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
MyScale Blog
MyScale Blog
P
Palo Alto Networks Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
AI
AI
T
Troy Hunt's Blog
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
S
Secure Thoughts
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Security @ Cisco Blogs
Cloudbric
Cloudbric
E
Exploit-DB.com RSS Feed
Attack and Defense Labs
Attack and Defense Labs

博客园 - Lexrate

[IT] 关闭笔记本的蜂鸣提示 新的工作 [TOOL] 小巧但强大的反删除工具restoration 元宵节快乐 [work] 累就一个字 test again 复杂的“人" 关于项目管理 测试2 测试 测试 测试 测试 [基础] 如何使用extern和static限定符 [设想] DOORS的替代方案 [随笔]艰辛而难忘的7个月 [系统]不要随意关闭WINDOWS Time服务 这几天的工作 [杂谈]很意味深长的话
[代码]大家来动动脑筋吧 - Lexrate - 博客园
Lexrate · 2006-04-19 · via 博客园 - Lexrate

要求:不使用正则表达式等,只依赖基本的字符串操作,在一个字符串数组中检查电话号码和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.并且要能够记录它们在字符串中的位置,并计算在哪一行。

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

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