According to
this post the maximum number of elements an array (in my example) can hold is 2 146 435 071.
I want to split a string into a list but the elements could be well over 10 000 000 000, therefore this may imply without using the Split method but if it can still be used that is also okay.
How can I do this with the best performance?
- Tried removing the first occurrence (described here) recursively while adding to the list until there is no delimiter but this is very slow
- The resulting elements of the list may span through several lines
Here is my code before any changes:
var allTokens = allText.Split(Delimiters).ToList();
Example of allText value:
fgfg,ghgh,"gjhj
hghdg,hjhgj",ghg
ghgh,kiwj,fhgfg,
hsk,,jw,"address line1
adrress line 2
zip code
country"
Problem: Large file throws OutOfMemoryException