What is the Fastest way to split ':' seperated string into given number of chunks where result/record length is variable
<p>I have a large string accepted from TCP listner which is in following format</p>

<p>"1,7620257787,0123456789,99,0922337203,9223372036,32.5455,87,12.7857,1/1/2012,9223372036:1,7620257787,0123456789,99,0922337203,9223372036,32.5455,87,12.7857:2/1/2012,234234234:3,7620257787,01234343456789,99,0922337203,9223372036,32.5455,87,12.7857,1/1/2012,9223372036:34,76202343457787,012434343456789,93339,34340922337203,9223372036,32.5455,87,12.7857,1/1/2012,9223372036"</p>

<p>You can see that this is a : seperated string which contains Records which are comma seperated fields.</p>

<p>I am looking for the best (fastest) way that split the string in given number of chunks and take care that one chunk should contain full record (string upto  ':')</p>

<p>or other way of saying , there should not be any chunck which is not ending with :</p>

<p>e.g. 20 MB string to 4 chunks of 5 MB each with proper records (thus size of each chunk may not be exactly 5 MB but very near to it and total of all 4 chunks will be 20 MB) </p>

<p>I hope you can understand my question (sorry for the bad english)</p>

<p>I like the following link , but it does not take care of full record while spliting also don't know if that is the best and fastest way.</p>

<p><a href="http://stackoverflow.com/questions/3008718/split-string-into-smaller-strings-by-length-variable">Split String into smaller Strings by length variable</a></p>
