Reputation: 4748
I have this huge string
String vStr = "('1','uno'),('2','dos'),('3','tres'),('4','cuatro')...('1000000','one millon')"
when i use the
vStr.split('),(')
i have an error outOfMemory exception in string.split
How can I do a split ? but to 500 parts at the time ?
Upvotes: 0
Views: 51
Reputation: 559
If you'd like to limit the number of resulting parts, just add desired parts as second argument of split() method.
vStr.split('),(', 500)
And maybe do this however many times you need in a loop or something.
Upvotes: 1