Multiple String loading
in
Programming Questions
•
11 months ago
hey. I guess this is pretty simple but I don't get it anway :( Hopefully anyone can help me out with this:
When I want to load a textfile i have to add the breaks ( \n) happening here
- for (int i=0; i < news.length; i++)
- {
- s += news[i] + "\n";
- println (s);
- }
Well this works perfectly as long as I got only one textfile. My problem is that I now have about 15 files and I don't want to start my script with 15 times for…
Is there a way I can compress it in 2 for loops, my idea was:
- for ( int j=0;j < 15; j++)
- {
- for (int i=0; i < news[j].length; i++)
- {
- s[j] += news[j][i] + "\n";
- println (s[j]);
- }
But this couldn't work because "s" isn't an array…
is there something I can do to get this to work?
best regards
1