I have a string which has many line and space.
For example:
string lines = "my name is omar\nliving in whateverf\ng i j";
I need to split it into a 2D array in which every word is in an index and each row represents a line.
Which means the 2D array should be more like this:
my name is omar
living in whatever
g i j
Is it possible?
I have tried splitting it first to lines and then spiting it to words, but I need id in a 2d array
string [] l = lines.split('\n');
for(int i = 0; i < l.length; i++)
{
string [] oneLine= l[i].split(' ');
//and put the rest of the code here
}