If I have an input of
this is a string
this is also a string
i am a string
can i store them in an array like
[0] this is a string
[1] this is also a string
[2] i am a string
If so, how can I achieve this kind of output?
If I have an input of
this is a string
this is also a string
i am a string
can i store them in an array like
[0] this is a string
[1] this is also a string
[2] i am a string
If so, how can I achieve this kind of output?
You could use:
String[] output = input.split"\\r?\\n");
That would split the lines if \r\n or \n is used for line breaks.