Hi, I started making a program and now I have problem... Quite obvious...
Well, I wonder if you can make every token using StringTokenizer to a new string.
If someone could help quick it would be nice.
Thanks :)
//Hjorth96
Printable View
Hi, I started making a program and now I have problem... Quite obvious...
Well, I wonder if you can make every token using StringTokenizer to a new string.
If someone could help quick it would be nice.
Thanks :)
//Hjorth96
Use String.spilt instead.
Will that split the whole sentence in the first string up in words? I want to make every word from that to a new string.
If the words are separated by spaces and you split around spaces you'll get an array of words.
E.g. if we have:
Code :String example = "This is an example string. What do you think?"; String[] tokens = example.split(" ");
Then tokens will be an array of strings
["This","is","an","example","string.","What","do"," you","think?"]
You could further clean it up to remove non-alphabetical characters and change the case.