all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
7
Task/Tokenize-a-string/Java/tokenize-a-string-1.java
Normal file
7
Task/Tokenize-a-string/Java/tokenize-a-string-1.java
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
String toTokenize = "Hello,How,Are,You,Today";
|
||||
|
||||
String words[] = toTokenize.split(",");//splits on one comma, multiple commas yield multiple splits
|
||||
//toTokenize.split(",+") if you want to ignore empty fields
|
||||
for(int i=0; i<words.length; i++) {
|
||||
System.out.print(words[i] + ".");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue