【发布时间】:2013-02-28 14:01:54
【问题描述】:
我使用下面的代码
String fulltext = "I would like to create some text and i dont know what creater34r3, ";
String subtext = "create";
int ind = -1;
do {
ind = fulltext.indexOf(subtext, ind + subtext.length());
} while (ind != -1);
结果,我找到了单词的第一个索引:
create creater34r3
但我只需要找到单词 create
怎么做?帮助
【问题讨论】:
-
你刚刚删除了你的问题并重新发布了吗?为什么?
-
一开始我更容易提出想法
-
您要查找“创建”吗? “创造。”? “创建”(在字符串的末尾)?
-
例如,当您在笔记本上写字并涂抹时 - 您拉了一块?