skiplatte 0 Newbie Poster

Hi, I have used Tokenizer to split a user input string into tokens and retained the delimiters (R and K). Is there any way to combine each delimiter with it's preceding token to create a result string? eg change tokens FGADA and R into one string FGADAR which I can pass on to another method.

StringTokenizer pepTokenizer = new StringTokenizer(inputString,"RK",true);

while (pepTokenizer.hasMoreTokens()){

    String Ion = pepTokenizer.nextToken();

Many Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.