We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How can I split a part of string array? Like:
String a[]={"processing is cool", "programing is funny", "bla bla"}; String b[]=new String[3];
I want to split one of those sentences to another array. Like split the sentence processing is cool to an array of:
1 processing
2 is
3 cool
Answers
well a[0] is the string "processing is cool"
and calling split() on a string will split it into sections...
https://processing.org/reference/split_.html
splitTokens() will do the same thing without having to specify the delimiter (space is default delimiter).
https://processing.org/reference/splitTokens_.html
https://processing.org/reference/splitTokens_.html or https://processing.org/reference/split_.html
As mentioned, splitTokens() can already deal w/ spaces, tabs, enters, returns, etc. by default: ;-)
String[] statementOne = splitTokens(statements[0]);