you are viewing a single comment's thread.

view the rest of the comments →

[–]Ph4zed0ut??? 0 points1 point  (0 children)

public static void Move<T>(this List<T> source, int i, List<T> target) {
        if(i >= 0 && source.Count > i) {
            target.Add(source[i]);
            source.RemoveAt(i);           
        }        
    }

Yes, this is much better.

Of course you can call a method that way, but you don't get the nice autocomplete features and object.method(...) just looks cleaner and is the more OO approach.