If a client wants to store a message into a txt file, user uses keyword msgstore followed by a quote.
Example:
msgstore
"ABC is as easy as 123"
I'm trying to split msgstore and the quote as two separate elements in an array.
What I currently have is:
String [] splitAdd = userInput.split(" ", 7);
but the problem I face is that it splits again after the second space so that it's:
splitAdd[0] = msgstore
splitAdd[1] = "ABC
splitAdd[2] = is
My question is, how do I combine the second half into a single array with an unknown length of elements so that it's:
splitAdd[0] = msgstore
splitAdd[1] = "ABC is as easy as 123"
I'm new to java, but I know it's easy to do in python with something like (7::).
Any advice?