Hi,
I can see that guys are already solved your problem but here is another one solution...
Try this simple extension method...
public static class ExtensionMethods
{
public static IEnumerable<string> Split(this string str, int chunkSize)
{
return Enumerable.Range(0, str.Length / chunkSize).Select(i => str.Substring(i * chunkSize, chunkSize));
}
}</string>
Usage:
string addressString = "12345678901234567890201234567890123456789040123456789012345678906012345678901234567890801234567890123456789020123456789012345678904012345678901234567890601234567890123456789080";
var addresses = addressString.Split(40);
foreach(string address in addresses)
{
}