I would like to split a string into 2 different arrays with no leading or ending whitespace. One array for the word and another for the definition. The delimiter is "-".
The input from the user would be: "Ice cream - is a sweetened frozen food typically eaten as a snack or dessert"
However, I am having trouble splitting the string into the respective arrays so that it would be something like this
String sen1 = "Ice cream - is a sweetened frozen food typically eaten as a snack or dessert";
word[0] = "Ice cream"; definition[0] = "is a sweetened frozen food typically eaten as a snack or dessert";
How would I split or otherwise accomplish that?