import java.util.StringTokenizer;
public class stringTokenTest {
public static void main(String[] args) {
String str = "hello how are you and where are you good one";
String delim = " ,;?'#%&*";
StringBuilder build = new StringBuilder();
StringBuilder string = null;
String s;
StringTokenizer token = new StringTokenizer(str, delim);
while (token.hasMoreElements()) {
s = token.nextToken();
string = build.append(" " + s).reverse();
}
System.out.println(string);
}
}
NOTE: implement it in C language without using built-in function
No comments:
Post a Comment