I'm having trouble thinking of a good name for the following extension method:
public static IEnumerable<T> TrimOrExpand<T>(this T[] items, int desiredCount)
{
var ratio = (double)items.Length / desiredCount;
for (int i = 0; i < desiredCount; i++)
yield return items[Convert.ToInt32(i * ratio)];
}
The thing I don't like about this method name is that "Trim" may communicate to the user that it's cutting off the last x records of the array, when actually it is excluding items at a regular interval throughout the array. Likewise it will also "Expand" the array by repeating items if you specify a count that is larger than items.Length.
Is there a better technical term for what I'm trying to do? Or is TrimOrExpand obvious enough to understand what it does?