Topic: 请问:java中有没有将句子自动分割成单词的方法(函数)? |
Print this page |
1.请问:java中有没有将句子自动分割成单词的方法(函数)? | Copy to clipboard |
Posted by: kaiserlew Posted on: 2004-11-04 21:07 输入一个英文句子(含空格),利用该函数将句子重空格处分割为单词。 如果有这个函数,返回的结果是什么? |
2.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: chengbd Posted on: 2004-11-04 21:43 String.split() |
3.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: kaiserlew Posted on: 2004-11-04 22:29 能否给一个简单的程序啊? 还有前面import ? |
4.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: haha石头 Posted on: 2004-11-05 09:17 在I/O流里面,有一个可以的 java.util.StringTokenizer |
5.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: 阿什 Posted on: 2004-11-08 18:59 能不能给点例子! 谢谢! |
6.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: kaiserlew Posted on: 2004-11-08 20:49 class A { public static void main(String [] args) { String a="hello hello hello how are you?"; String[] c=a.split(" "); for(int i=0;i<c.length;i++) System.out.println(c[i]); } } |
7.Re:请问:java中有没有将句子自动分割成单词的方法(函数)? [Re: kaiserlew] | Copy to clipboard |
Posted by: why Posted on: 2004-11-08 21:26 from The Java Developers Almanac 1.4 e332. Breaking a String into Words (StringTokenizer) http://javaalmanac.com/egs/java.util/ParseString.html e431. Parsing Character-Separated Data with a Regular Expression (Split) http://javaalmanac.com/egs/java.util.regex/ParseLine.html |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |