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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
Y
Y Combinator Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
S
SegmentFault 最新的问题
J
Java Code Geeks
V
Visual Studio Blog
H
Help Net Security
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - Franky
B
Blog RSS Feed
The Cloudflare Blog
MyScale Blog
MyScale Blog
月光博客
月光博客
Microsoft Security Blog
Microsoft Security Blog
美团技术团队

博客园 - 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.并且要能够记录它们在字符串中的位置,并计算在哪一行。

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

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