quick-guide-to-the-java-stringtokenizer (#1587)
* rest with spark java * 4 * Update Application.java * indentation changes * spring @requestmapping shortcuts * removing spring requestmapping and pushing spring-mvc-java * Joining/Splitting Strings with Java and Stream API * adding more join/split functionality * changing package name * testcase change * adding webutils * adding testcase for WebUtils and ServletRequestUtils * adding testcase * spring-security-stormpath * adding ratpack module * adding pom.xml * adding following modules with updated testcase : DB, Filter, Json * adding spring-boot custom banner tutorial * changing banner format in plain text * Delete banner.txt~ * Delete b.txt~ * CORS in JAX-RS * ratpack with google guice * adding factory instance example * quick-guide-to-the-java-stringtokenizer * Update Application.java * Delete MovieCrudService.java~
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.baeldung.stringtokenizer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class Application {
|
||||
|
||||
public List<String> getTokens(String str) {
|
||||
List<String> tokens = new ArrayList<String>();
|
||||
// StringTokenizer tokenizer = new StringTokenizer( str );
|
||||
StringTokenizer tokenizer = new StringTokenizer( str , "," );
|
||||
// StringTokenizer tokenizer = new StringTokenizer( str , "," , true );
|
||||
while (tokenizer.hasMoreElements()) {
|
||||
tokens.add( tokenizer.nextToken() );
|
||||
// tokens.add( tokenizer.nextToken( "," ) );
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user