Home » U++ Library support » U++ Library : Other (not classified elsewhere) » How to split a sentence into words
How to split a sentence into words [message #29773] |
Tue, 16 November 2010 08:22 |
o_wild
Messages: 28 Registered: December 2008 Location: Urmqi
|
Promising Member |
|
|
Hi, everybody. I can find built-in split functions in other languages or platforms, see below.
// a java program that split a sentence into words
import java.util.Scanner;
public class StringBufferedTest {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.print("Please Input a sentence: ");
String sent=sc.nextLine();
String str[]=sent.split(" ");
for(int i=0;i<str.length;i++){
System.out.println(str[i]);
}
}
}
But in U++, i haven't found the same function yet. How can i implement this function?
[Updated on: Tue, 16 November 2010 08:58] by Moderator Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sun May 19 16:57:08 CEST 2024
Total time taken to generate the page: 0.01360 seconds
|