1. StringTokenizer to remove 3 consecutive words coderanch.comHi guys, look at my code below. my goal is to eliminate the words "on the moon" from the sentence: "there is a man on the moon with a dell computer"; I receive this result: r is a a wi a DELL cpur import java.util.*; public class Editor { public static void main(String args[]) { String str = "there is a ... |
2. Read a line of text and reverse each word do not use StringTokenizer coderanch.comI have tried a lot but i am not able to remove the ArrayIndexOutOfBounds Exception at runtime but it compiles just fine import java.util.*; public class Rev { static void rev(String jik){ //method to reverse the given string int i,j; char ji[]=new char[jik.length()]; for(i=0,j=jik.length();i |
3. Java stringtokenizer- making it reverse word java-forums.orgWithin your while loop, you are calling the nextToken() method twice, meaning that it is reading two tokens for each pass through the loop rather than just one. You should store the return value of the first call to nextToken() in a String variable, and refer to that variable later in the loop rather than calling nextToken() a second time. Also, ... |
4. How to Exclude Java Reserved Words Using StringTokenizer forums.oracle.com |