Here’s my rather clumsy solution:
// Duplicate last element
{
List<PointF> t;
t = tiles.ToList();
t.Add(tiles.LastOrDefault());
tiles = t.ToArray();
}
The strange fact that .Add does not return the list means one statement is forced to be four.
What’s a better e.g. more concise way? Thanks.
I’m finding your example difficult to follow… let me know if this makes sense.
This example takes an array and duplicates the last item.
In your case it looks like
tilesis an array ofPointF. If you want to duplicate the last element all you have to do is: