I have created a function wherein I split a string from the csv filecsvAsString.split('\n')
. It is working when the string is not so big. But when I try to split a very large string, an error will occur
regex too complicated
what I want to do is to catch if an error occur during the split process. How will I do it ? I've tried to use try and catch but the problem still occur. Is there any other possible solution?
Best Answer
Not a catch per say (IIRC you cannot catch it, especially if
Catch Exception
did not work) but will solve the problem of regex to complex, use a custom iterator:CLASS
CODE
TEST CLASS (Provided by @KateFedchenko)