Code:
class file2{
public static void main(String[] args) throws IOException {
String st1="You may choose an icon for you";
// If you know the string length is constant e.g: 30
// you don't need an iterator.
System.out.println(st1.substring(0, 10)); // Returns chars 0 through 9
System.out.println(st1.substring(10, 20)); // Returns chars 10 through 19
System.out.println(st1.substring(20)); //Returns chars 20 to end
StringTokenizer st = new StringTokenizer(st1,"10");
while (st.hasMoreTokens()) {
System.out.println(st.nextToken());
}
}