Can anyone advise on an issue that’s been bugging me? I have a Java .jar file which returns a string from a method made up as follows:
integer integer integer block_of_text
That is three integers which may be positive or negative, each separated by single spaces, and then another space before a block of text which may consist of any characters but which should not contain carriage returns. Now I suppose I can read a substring up to the space character for each of the initial integers and then simply read the remaining text in one go.
I should add that the block of text is not to be broken down regardless of what it contains.
But can anyone suggest a better alternative?
Thanks to the respondents. This has saved me a headache!
You can use the form of
String#split(regex,limit)which takes a limit: