Hi,
I have been trying to figure out how to split a large String into smaller Strings.
so if I have a String such as the following:
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
how is it possible to break up such a String (which maybe upto 4 Million characters in length) into a series of smaller Strings of length 30,000 for example.
I have tried to do this using the subString() method, however, this is not practical for larger Strings - since I encounter StringIndexOutOfBoundsExceptions when the second argument to the subString() method is greater than the length of each of the individual lines in the String (60 in the example above).
Any Suggestions?
Many thanks
I have been trying to figure out how to split a large String into smaller Strings.
so if I have a String such as the following:
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH
how is it possible to break up such a String (which maybe upto 4 Million characters in length) into a series of smaller Strings of length 30,000 for example.
I have tried to do this using the subString() method, however, this is not practical for larger Strings - since I encounter StringIndexOutOfBoundsExceptions when the second argument to the subString() method is greater than the length of each of the individual lines in the String (60 in the example above).
Any Suggestions?
Many thanks