Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Extension method for splitting into multiple parts:
using System.Collections.Generic;
using System.Linq;
namespace Helpers
{
public static class ArrayHelperExtensions
{
public static IEnumerable<IEnumerable<T>> Split<T>(this T[] array, int size)
{
for (var i = 0; i < (float) array.Length/size; i++)
{
yield return array.Skip(i*size).Take(size);
}
}
}
}
var num = 3;
var parts = listbox1.Items.Split(num);
Obviously split and then save.
How do you want to share them? On what basis?
There are no signs! You need to split the listbox data into N files.
For example, in a listbox of 1000 items, they need to be divided into 3 files: i.e. you need to create 1 file with 334 lines of data, the next file with 334, and the last one with 332.
I don't understand how to implement the division algorithm itself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question