We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f202f38 commit 402678fCopy full SHA for 402678f
String/String_Tokenizer.java
@@ -0,0 +1,22 @@
1
+// reverse_each_word
2
+import java.util.*;
3
+public class reverse_each_word
4
+{
5
+ public static void main()
6
+ {
7
+ Scanner ob=new Scanner(System.in);
8
+ int i,j;
9
+ System.out.println("enter string");
10
+ StringTokenizer s=new StringTokenizer(ob.nextLine(),"!");
11
+ int n=s.countTokens();//count words
12
+ String a[]=new String[n];
13
+ for(i=0;i<n;i++)
14
15
+ a[i]=s.nextToken();
16
+ }
17
+ for(i=n-1;i>=0;i--)
18
19
+ System.out.print(a[i]+" ");
20
21
22
+}
0 commit comments