Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
StringTokenizer class in Java
The StringTokenizer class of the java.util package allows an application to break a string into tokens.
- This class is a legacy class that is retained for compatibility reasons although its use is discouraged in new code.
- Its methods do not distinguish among identifiers, numbers, and quoted strings.
- This class methods do not even recognize and skip comments.
Example
import java.util.*;
public class Sample {
public static void main(String[] args) {
// creating string tokenizer
StringTokenizer st = new StringTokenizer("Come to learn");
// checking next token
System.out.println("Next token is : " + st.nextToken());
}
}
Output
Next token is : Come
Advertisements
